Exemplo n.º 1
0
 public void AddTool(GridBoxType type, Unit unit, Rectangle rect)
 {
     switch (type)
     {
         case GridBoxType.Enemy:
             enemyTools.Add(new ToolEntity(unit, rect, false, false));
             break;
         case GridBoxType.Landscape:
             landscapeTools.Add(new ToolEntity(unit, rect, false, false));
             break;
         case GridBoxType.Obstruction:
             obstructionTools.Add(new ToolEntity(unit, rect, false, false));
             break;
         default:
             throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + type.ToString());
     }
 }
Exemplo n.º 2
0
 public List<ToolEntity> getTools(GridBoxType type)
 {
     switch (type)
     {
         case GridBoxType.Enemy:
             return enemyTools;
             break;
         case GridBoxType.Landscape:
             return landscapeTools;
             break;
         case GridBoxType.Obstruction:
             return obstructionTools;
             break;
     default:
             throw new Exception("Undefined GridBoxType found when return unit to Units list: " + type.ToString());
     }
 }
Exemplo n.º 3
0
 public void addUnit(GridBoxType gridType, string name, Unit unit)
 {
     switch (gridType)
     {
         case GridBoxType.Enemy:
             enemyTools[name] = unit;
             enemyNameList.Add(name);
             break;
         case GridBoxType.Landscape:
             landscapeTools[name] = unit;
             landscapeNameList.Add(name);
             break;
         case GridBoxType.Obstruction:
             obstructionTools[name] = unit;
             obstructionNameList.Add(name);
             break;
         default:
             throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + gridType.ToString());
     }
 }
Exemplo n.º 4
0
        public int Count(GridBoxType gridType)
        {
            switch (gridType)
            {
            case GridBoxType.Enemy:
                return(enemyTools.Count);

                break;

            case GridBoxType.Landscape:
                return(landscapeTools.Count);

                break;

            case GridBoxType.Obstruction:
                return(obstructionTools.Count);

                break;

            default:
                throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + gridType.ToString());
            }
        }
Exemplo n.º 5
0
        public Unit getUnit(GridBoxType gridType, string unitName)
        {
            switch (gridType)
            {
            case GridBoxType.Enemy:
                return((Unit)enemyTools[unitName]);

                break;

            case GridBoxType.Landscape:
                return((Unit)landscapeTools[unitName]);

                break;

            case GridBoxType.Obstruction:
                return((Unit)obstructionTools[unitName]);

                break;

            default:
                throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + gridType.ToString());
            }
        }
Exemplo n.º 6
0
        public void addUnit(GridBoxType gridType, string name, Unit unit)
        {
            switch (gridType)
            {
            case GridBoxType.Enemy:
                enemyTools[name] = unit;
                enemyNameList.Add(name);
                break;

            case GridBoxType.Landscape:
                landscapeTools[name] = unit;
                landscapeNameList.Add(name);
                break;

            case GridBoxType.Obstruction:
                obstructionTools[name] = unit;
                obstructionNameList.Add(name);
                break;

            default:
                throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + gridType.ToString());
            }
        }
Exemplo n.º 7
0
 public Unit getUnit(GridBoxType gridType, string unitName)
 {
     switch (gridType)
     {
         case GridBoxType.Enemy:
             return (Unit) enemyTools[unitName];
             break;
         case GridBoxType.Landscape:
             return (Unit) landscapeTools[unitName];
             break;
         case GridBoxType.Obstruction:
             return (Unit)obstructionTools[unitName];
             break;
         default:
             throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + gridType.ToString());
     }
 }
Exemplo n.º 8
0
 public int Count(GridBoxType gridType)
 {
     switch (gridType)
     {
         case GridBoxType.Enemy:
             return enemyTools.Count;
             break;
         case GridBoxType.Landscape:
             return landscapeTools.Count;
             break;
         case GridBoxType.Obstruction:
             return obstructionTools.Count;
             break;
         default:
             throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + gridType.ToString());
     }
 }
Exemplo n.º 9
0
        public List <ToolEntity> getTools(GridBoxType type)
        {
            switch (type)
            {
            case GridBoxType.Enemy:
                return(enemyTools);

                break;

            case GridBoxType.Landscape:
                return(landscapeTools);

                break;

            case GridBoxType.Obstruction:
                return(obstructionTools);

                break;

            default:
                throw new Exception("Undefined GridBoxType found when return unit to Units list: " + type.ToString());
            }
        }
Exemplo n.º 10
0
        public void AddTool(GridBoxType type, Unit unit, Rectangle rect)
        {
            switch (type)
            {
            case GridBoxType.Enemy:
                enemyTools.Add(new ToolEntity(unit, rect, false, false));
                break;

            case GridBoxType.Landscape:
                landscapeTools.Add(new ToolEntity(unit, rect, false, false));
                break;

            case GridBoxType.Obstruction:
                obstructionTools.Add(new ToolEntity(unit, rect, false, false));
                break;

            default:
                throw new Exception("Undefined GridBoxType found when adding unit to Units list: " + type.ToString());
            }
        }