示例#1
0
        public Result UpgradeController(StructureController controller)
        {
            var result = new Result {
                TypeID = ResultTypes.UnknownError
            };

            if (controller != null)
            {
                int range = Pos.GetRangeTo(controller.Pos);

                if (range <= 1)
                {
                    if (typeof(StructureController).IsAssignableFrom(controller.GetType()))
                    {
                        result = Game.AddAction(new CreepUpgrade(this, controller));
                    }
                    else
                    {
                        result = new Result {
                            TypeID = ResultTypes.InvalidTarget
                        };
                    }
                }
                else
                {
                    result = new Result {
                        TypeID = ResultTypes.TooFar
                    };
                }
            }
            else
            {
                result = new Result {
                    TypeID = ResultTypes.EmptyTarget
                };
            }

            return(result);
        }
示例#2
0
 public Result GenerateSafeMode(StructureController controller)
 {
     throw new NotImplementedException();
 }
示例#3
0
 public Result SignController(StructureController controller, string msg = null)
 {
     throw new NotImplementedException();
 }
示例#4
0
 public Result ClaimController(StructureController controller)
 {
     throw new NotImplementedException();
 }