Esempio n. 1
0
    void RemoveOccupiedTiles(Dictionary <Vector3Int, Node> moves)
    {
        Dictionary <Vector3Int, Unit> units = unitsManager.GetAllPlayerUnits();

        foreach (KeyValuePair <Vector3Int, Unit> unit in units)
        {
            if (moves.ContainsKey(unit.Key))
            {
                moves.Remove(unit.Key);
            }
        }
        units = unitsManager.GetAllEnemyUnits();
        foreach (KeyValuePair <Vector3Int, Unit> unit in units)
        {
            if (moves.ContainsKey(unit.Key))
            {
                moves.Remove(unit.Key);
            }
        }
        units = unitsManager.GetAllNPCUnits();
        foreach (KeyValuePair <Vector3Int, Unit> unit in units)
        {
            if (moves.ContainsKey(unit.Key))
            {
                moves.Remove(unit.Key);
            }
        }
    }
Esempio n. 2
0
 void GetAIUnits()
 {
     units = new Queue <Unit>();
     foreach (KeyValuePair <Vector3Int, Unit> unit in unitsManager.GetAllEnemyUnits())
     {
         units.Enqueue(unit.Value);
     }
 }