예제 #1
0
        bool buildStructure(BuildStructureCommand command)
        {
            bool allowBuild = Rts.pathFinder.Tools.CanStructureBePlaced(command.StructureLocation, command.StructureType.Size, this, command.StructureType.CutCorners);

            if (allowBuild)
            {
                //if (command.StructureType == StructureType.Barracks)
                //    new Barracks(command.StructureLocation, this, Team);

                Structure structure;

                if (command.StructureType == StructureType.TownHall)
                {
                    structure = new TownHall(command.StructureLocation, this, Team);
                }
                else
                {
                    structure = new Structure(command.StructureType, command.StructureLocation, this, Team);
                }

                CenterPoint = structure.CenterPoint;
                //IgnoringCollision = true;
                Targetable = false;
                Busy       = true;
                Building   = true;
                Unit.RemoveUnit(this);
            }

            return(allowBuild);
        }
예제 #2
0
        bool harvest(Resource resource)
        {
            MineResource roks = resource as MineResource;

            if (roks != null)
            {
                if (roks.CheckForEntrance(this))
                {
                    Targetable = false;
                    Busy       = true;
                    Unit.RemoveUnit(this);

                    return(true);
                }
            }

            return(false);
        }