Beispiel #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);
        }
Beispiel #2
0
 public Result GenerateSafeMode(StructureController controller)
 {
     throw new NotImplementedException();
 }
Beispiel #3
0
 public Result SignController(StructureController controller, string msg = null)
 {
     throw new NotImplementedException();
 }
Beispiel #4
0
 public Result ClaimController(StructureController controller)
 {
     throw new NotImplementedException();
 }