#region Copyright & License Information /* * Copyright 2007-2014 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 System; using OpenRA.Traits; namespace OpenRA.Mods.RA.Scripting { [Desc("Part of the legacy Lua API.")] public class LuaScriptEventsInfo : TraitInfo { } public class LuaScriptEvents : INotifyKilled, INotifyAddedToWorld, INotifyRemovedFromWorld, INotifyCapture, INotifyDamage, INotifyIdle, INotifyProduction { public event Action OnKilled = (self, e) => { }; public event Action OnAddedToWorld = self => { }; public event Action OnRemovedFromWorld = self => { }; public event Action OnCaptured = (self, captor, oldOwner, newOwner) => { }; public event Action OnDamaged = (self, e) => { }; public event Action OnIdle = self => { }; public event Action OnProduced = (self, other, exit) => { }; public void Killed(Actor self, AttackInfo e) { OnKilled(self, e); } public void AddedToWorld(Actor self) { OnAddedToWorld(self); } public void RemovedFromWorld(Actor self) { OnRemovedFromWorld(self); } public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner) { OnCaptured(self, captor, oldOwner, newOwner); } public void Damaged(Actor self, AttackInfo e) { OnDamaged(self, e); } public void TickIdle(Actor self) { OnIdle(self); } public void UnitProduced(Actor self, Actor other, CPos exit) { OnProduced(self, other, exit); } } }