Update Lua bindings to use array arguments.

This commit is contained in:
Paul Chote
2014-10-04 11:14:14 +13:00
parent 471dc409b7
commit 85b26d1ff8
7 changed files with 70 additions and 164 deletions

View File

@@ -26,11 +26,11 @@ namespace OpenRA.Mods.RA.Scripting
public string Name { get { return player.PlayerName; } }
[Desc("Returns an array of actors representing all ground attack units of this player.")]
public LuaTable GetGroundAttackers()
public Actor[] GetGroundAttackers()
{
return player.World.ActorsWithTrait<AttackBase>().Select(a => a.Actor)
.Where(a => a.Owner == player && !a.IsDead() && a.IsInWorld && a.HasTrait<Mobile>())
.Select(a => a.ToLuaValue(context)).ToLuaTable(context);
.ToArray();
}
}
}