Наследование: MSChangeableBuilding
Пример #1
0
 public MSVolunteer(Vector3 position, Node path_to_mobber, MSUnit target, MSTower office, MSMap map, float initRotation)
     : base(position, path_to_mobber, map, false, initRotation)
 {
     this.target = target;
     this.office = office;
     this.isGoingToMobber = true;
 }
Пример #2
0
        public void SendVolunteer(MSMap map, MSUnit unit, MSTower office)
        {
            Node path1 = map.GetPath(new Vector2(office.Row, office.Column), unit.TileCoordinate);

            Node pathEnd = path1;
            while (pathEnd.next != null)
            {
                pathEnd = pathEnd.next;
            }
            pathEnd.next = unit.Path;

            MSVolunteer volunteer = new MSVolunteer
            (
                office.Position + MSUnit.UNITZ_POSITION,
                path1,
                unit,
                office,
                map,
                0
            );

            MSUnitHandler.GetInstance().AddUnit(volunteer);
        }
Пример #3
0
        public static MS3DTile loadMSTile(StreamReader sr)
        {
            MS3DTile toReturn = null;
            String id = sr.ReadLine();
            String modelName = sr.ReadLine();
            String textureName = sr.ReadLine();
            String effectName = sr.ReadLine();
            string[] position = sr.ReadLine().Split(' ');
            Vector3 pos = Vector3.Zero;
            pos.X = float.Parse(position[0]);
            pos.Y = float.Parse(position[1]);
            pos.Z = float.Parse(position[2]);
            float rotation = float.Parse(sr.ReadLine());
            int row = Int32.Parse(sr.ReadLine());
            int column = Int32.Parse(sr.ReadLine());

            if (id.Equals("MSRoad"))
            {
                toReturn = new MSRoad(modelName, textureName, effectName, pos, rotation, row, column);
            }
            else if (id.Equals("MSVolunteerCenter"))
            {
                toReturn = new MSVolunteerCenter(modelName, textureName, effectName, pos, rotation, row, column);
            }
            else if (id.Equals("MSUnchangeableBuilding"))
            {
                toReturn = new MSUnchangeableBuilding(modelName, textureName, effectName, pos, rotation, row, column);
            }
            else if (id.Equals("MSFundraiser"))
            {
                toReturn = new MSFundraiser(modelName, textureName, effectName, pos, rotation, row, column, MSResourceManager.GetInstance());
                (toReturn as MSFundraiser).load(sr);
            }
            else if (id.Equals("MSDistrictHall"))
            {
                MSDistrictHall.instantiate(modelName, textureName, effectName, pos, rotation, row, column);
                toReturn = MSDistrictHall.getInstance();
            }
            else if (id.Equals("MSAbandonedBuilding"))
            {
                toReturn = new MSAbandonedBuilding(modelName, textureName, effectName, pos, rotation, row, column);
                (toReturn as MSAbandonedBuilding).load(sr);
            }
            else if (id.Equals("MSTower"))
            {

                toReturn = new MSTower(modelName, textureName, effectName, pos, rotation, row, column, MSMap.tallheight, null );
                (toReturn as MSTower).load(sr);
            }

            return toReturn;
        }