コード例 #1
0
ファイル: GamePainter.cs プロジェクト: RyannnnnnR/TowerWars
 /// <summary>
 /// Defines all unit cells.
 /// </summary>
 private void InitialiseCells()
 {
     townCell    = new UnitCell(Position.TOWN_CELL_X, Position.TOWN_LABEL_X, UnitType.Town);
     mageCell    = new UnitCell(Position.MAGE_CELL_X, Position.MAGE_LABEL_X, UnitType.Mage);
     rangerCell  = new UnitCell(Position.RANGER_CELL_X, Position.RANGER_LABEL_X, UnitType.Ranger);
     ninjaCell   = new UnitCell(Position.NINJA_CELL_X, Position.NINJA_LABEL_X, UnitType.Ninja);
     healerCell  = new UnitCell(Position.HEALER_CELL_X, Position.HEALER_LABEL_X, UnitType.Healer);
     warriorCell = new UnitCell(Position.WARRIOR_CELL_X, Position.WARRIOR_LABEL_X, UnitType.Warrior);
     manager.AddUnitCell(townCell);
     manager.AddUnitCell(mageCell);
     manager.AddUnitCell(rangerCell);
     manager.AddUnitCell(ninjaCell);
     manager.AddUnitCell(healerCell);
     manager.AddUnitCell(warriorCell);
 }
コード例 #2
0
 /// <summary>
 /// Adds a unit cell to a list
 /// </summary>
 /// <param name="cell">A unit cell</param>
 public void AddUnitCell(UnitCell cell)
 {
     unitcells.Add(cell);
 }