move ActorGroupProxy to mod; move SupportPower traits into directory
This commit is contained in:
27
OpenRA.Mods.RA/Player/ActorGroupProxy.cs
Executable file
27
OpenRA.Mods.RA/Player/ActorGroupProxy.cs
Executable file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
class ActorGroupProxyInfo : TraitInfo<ActorGroupProxy> { }
|
||||
|
||||
class ActorGroupProxy : IResolveOrder
|
||||
{
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "CreateGroup")
|
||||
{
|
||||
/* create a group */
|
||||
var actors = order.TargetString.Split(',')
|
||||
.Select(id => uint.Parse(id))
|
||||
.Select(id => self.World.Actors.FirstOrDefault(a => a.ActorID == id))
|
||||
.Where(a => a != null);
|
||||
|
||||
var g = new Group(actors);
|
||||
// g.Dump();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user