Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a70d33fc91
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 44 lines (35 sloc) 1.084 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#region Copyright & License Information
/*
* Copyright 2007-2012 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion

using OpenRA.Traits;

namespace OpenRA.Mods.RA
{
class CaptureNotificationInfo : ITraitInfo
{
public readonly string Race = null;
public readonly string Notification = null;

public object Create(ActorInitializer init) { return new CaptureNotification(this); }
}

class CaptureNotification : INotifyCapture
{
CaptureNotificationInfo Info;
public CaptureNotification(CaptureNotificationInfo info)
{
Info = info;
}

public void OnCapture (Actor self, Actor captor, Player oldOwner, Player newOwner)
{
if (captor.World.LocalPlayer != captor.Owner)
return;

if (Info.Race != null && Info.Race != newOwner.Country.Race)
return;

Sound.PlayToPlayer(captor.World.LocalPlayer, Info.Notification);
}
}
}

Something went wrong with that request. Please try again.