Merge pull request #9134 from clemty/docs

minor LUA and trait documentation fixes, whitespace fixes
This commit is contained in:
reaperrr
2015-08-24 21:26:20 +02:00
28 changed files with 51 additions and 51 deletions

View File

@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Create a new WDist.")] [Desc("Create a new WDist.")]
public WDist New(int r) { return new WDist(r); } public WDist New(int r) { return new WDist(r); }
[Desc("Create a new WDist by cell distance")] [Desc("Create a new WDist by cell distance.")]
public WDist FromCells(int numCells) { return WDist.FromCells(numCells); } public WDist FromCells(int numCells) { return WDist.FromCells(numCells); }
} }

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Scripting
get { return DateTime.Today.Month == 10 && DateTime.Today.Day == 31; } get { return DateTime.Today.Month == 10 && DateTime.Today.Day == 31; }
} }
[Desc("Get the current game time (in ticks)")] [Desc("Get the current game time (in ticks).")]
public int GameTime public int GameTime
{ {
get { return Context.World.WorldTick; } get { return Context.World.WorldTick; }

View File

@@ -393,7 +393,7 @@ namespace OpenRA.Mods.Common.Scripting
return triggerId; return triggerId;
} }
[Desc("Removes a previously created proximitry trigger.")] [Desc("Removes a previously created proximity trigger.")]
public void RemoveProximityTrigger(int id) public void RemoveProximityTrigger(int id)
{ {
Context.World.ActorMap.RemoveProximityTrigger(id); Context.World.ActorMap.RemoveProximityTrigger(id);
@@ -407,14 +407,14 @@ namespace OpenRA.Mods.Common.Scripting
} }
[Desc("Call a function when this actor is discovered by an enemy or a player with a Neutral stance. " + [Desc("Call a function when this actor is discovered by an enemy or a player with a Neutral stance. " +
"The callback function will be called as func(Actor discovered, Player discoverer)")] "The callback function will be called as func(Actor discovered, Player discoverer).")]
public void OnDiscovered(Actor a, LuaFunction func) public void OnDiscovered(Actor a, LuaFunction func)
{ {
GetScriptTriggers(a).RegisterCallback(Trigger.OnDiscovered, func, Context); GetScriptTriggers(a).RegisterCallback(Trigger.OnDiscovered, func, Context);
} }
[Desc("Call a function when this player is discovered by an enemy or neutral player. " + [Desc("Call a function when this player is discovered by an enemy or neutral player. " +
"The callback function will be called as func(Player discovered, Player discoverer, Actor discoveredActor)")] "The callback function will be called as func(Player discovered, Player discoverer, Actor discoveredActor).")]
public void OnPlayerDiscovered(Player discovered, LuaFunction func) public void OnPlayerDiscovered(Player discovered, LuaFunction func)
{ {
GetScriptTriggers(discovered.PlayerActor).RegisterCallback(Trigger.OnPlayerDiscovered, func, Context); GetScriptTriggers(discovered.PlayerActor).RegisterCallback(Trigger.OnPlayerDiscovered, func, Context);

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Scripting
} }
[ScriptActorPropertyActivity] [ScriptActorPropertyActivity]
[Desc("Moves from outside the world into the cell grid")] [Desc("Moves from outside the world into the cell grid.")]
public void MoveIntoWorld(CPos cell) public void MoveIntoWorld(CPos cell)
{ {
Self.QueueActivity(mobile.MoveIntoWorld(Self, cell, mobile.ToSubCell)); Self.QueueActivity(mobile.MoveIntoWorld(Self, cell, mobile.ToSubCell));

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Scripting
.ToArray(); .ToArray();
} }
[Desc("Returns all living actors of the specified type of this player")] [Desc("Returns all living actors of the specified type of this player.")]
public Actor[] GetActorsByType(string type) public Actor[] GetActorsByType(string type)
{ {
var result = new List<Actor>(); var result = new List<Actor>();

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Scripting
rp = self.Trait<RallyPoint>(); rp = self.Trait<RallyPoint>();
} }
[Desc("Query or set a factory's rally point")] [Desc("Query or set a factory's rally point.")]
public CPos RallyPoint public CPos RallyPoint
{ {
get { return rp.Location; } get { return rp.Location; }
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Scripting
pb = self.Trait<PrimaryBuilding>(); pb = self.Trait<PrimaryBuilding>();
} }
[Desc("Query or set the factory's primary building status")] [Desc("Query or set the factory's primary building status.")]
public bool IsPrimaryBuilding public bool IsPrimaryBuilding
{ {
get { return pb.IsPrimary; } get { return pb.IsPrimary; }
@@ -204,7 +204,7 @@ namespace OpenRA.Mods.Common.Scripting
"If an actionFunc is given, it will be called as actionFunc(Actor[] actors) once " + "If an actionFunc is given, it will be called as actionFunc(Actor[] actors) once " +
"production of all actors has been completed. The actors array is guaranteed to " + "production of all actors has been completed. The actors array is guaranteed to " +
"only contain alive actors. Note: This function will fail to work when called " + "only contain alive actors. Note: This function will fail to work when called " +
"during the first tick")] "during the first tick.")]
public bool Build(string[] actorTypes, LuaFunction actionFunc = null) public bool Build(string[] actorTypes, LuaFunction actionFunc = null)
{ {
var typeToQueueMap = new Dictionary<string, string>(); var typeToQueueMap = new Dictionary<string, string>();