CreateSprite() публичный Метод

public CreateSprite ( Mpq mpq, byte palette ) : Sprite
mpq Mpq
palette byte
Результат Sprite
Пример #1
0
        void PlaceInitialUnits()
        {
            List <UnitInfo> unit_infos = scenario.Units;

            List <Unit> startLocations = new List <Unit>();

            units = new List <Unit>();

            foreach (UnitInfo unitinfo in unit_infos)
            {
                if (unitinfo.unit_id == 0xffff)
                {
                    break;
                }

                Unit unit = new Unit(unitinfo);

                /* we handle start locations in a special way, below */
                if (unit.FlingyId == 140)
                {
                    startLocations.Add(unit);
                    continue;
                }

                //players[unitinfo.player].AddUnit (unit);

                unit.CreateSprite(mpq, tileset_palette);
                units.Add(unit);
            }

            if (template != null && (template.InitialUnits != InitialUnits.UseMapSettings))
            {
                foreach (Unit sl in startLocations)
                {
                    /* terran command center = 106,
                     * zerg hatchery = 131,
                     * protoss nexus = 154 */

                    Unit unit = new Unit(154);
                    unit.X = sl.X;
                    unit.Y = sl.Y;

                    unit.CreateSprite(mpq, tileset_palette);
                    units.Add(unit);
                }
            }

            /* for now assume the player is at startLocations[0], and center the view there */
            Recenter(startLocations[0].X, startLocations[0].Y);
        }
Пример #2
0
		void PlaceInitialUnits ()
		{
			List<UnitInfo> unit_infos = scenario.Units;

			List<Unit> startLocations = new List<Unit>();

			units = new List<Unit>();

			foreach (UnitInfo unitinfo in unit_infos) {
				if (unitinfo.unit_id == 0xffff)
					break;

				Unit unit = new Unit (unitinfo);

				/* we handle start locations in a special way, below */
				if (unit.FlingyId == 140) {
					startLocations.Add (unit);
					continue;
				}

				//players[unitinfo.player].AddUnit (unit);

				unit.CreateSprite (mpq, tileset_palette);
				units.Add (unit);
			}

			if (template != null && (template.InitialUnits != InitialUnits.UseMapSettings)) {
				foreach (Unit sl in startLocations) {
					/* terran command center = 106,
					   zerg hatchery = 131,
					   protoss nexus = 154 */

					Unit unit = new Unit (154);
					unit.X = sl.X;
					unit.Y = sl.Y;

					unit.CreateSprite (mpq, tileset_palette);
					units.Add (unit);
				}
			}

			/* for now assume the player is at startLocations[0], and center the view there */
			Recenter (startLocations[0].X, startLocations[0].Y);
		}