예제 #1
0
 public void setSenderID(int senderID, eFactionName factionName, int damage)
 {
     Assert.IsTrue(m_senderID == Utilities.INVALID_ID);
     m_senderFaction = factionName;
     m_senderID      = senderID;
     m_damage        = damage;
 }
예제 #2
0
 public bool isEnemyOnPosition(Vector2Int position, eFactionName factionName, out int targetID)
 {
     Assert.IsTrue(isInBounds(position));
     if (getPoint(position).unitID != Utilities.INVALID_ID)
     {
         targetID = getPoint(position).unitID;
         return(getPoint(position).unitFactionName != factionName);
     }
     else
     {
         targetID = Utilities.INVALID_ID;
         return(false);
     }
 }
예제 #3
0
    public FactionInfluenceMap(eFactionName ownerName)
    {
        m_ownerName = ownerName;
        Vector2Int mapSize = Map.Instance.m_mapSize;

        m_map = new PointOnInfluenceMap[mapSize.y, mapSize.x];
        for (int x = 0; x < mapSize.x; ++x)
        {
            for (int y = 0; y < mapSize.y; ++y)
            {
                m_map[x, y] = new PointOnInfluenceMap();
            }
        }
    }
예제 #4
0
    public List <Unit> getOpposingFactionUnits(eFactionName sendingFaction)
    {
        switch (sendingFaction)
        {
        case eFactionName.Red:
            return(m_factions[(int)eFactionName.Blue].m_units);

        case eFactionName.Blue:
            return(m_factions[(int)eFactionName.Red].m_units);

        default:
            Assert.IsTrue(false);
            return(null);
        }
    }
예제 #5
0
 public bool isOccupiedByEnemy(eFactionName factionName)
 {
     return(unitID != Utilities.INVALID_ID && factionName != unitFactionName);
 }
예제 #6
0
 public void assign(int ID, eFactionName factionName)
 {
     unitID          = ID;
     unitFactionName = factionName;
 }
예제 #7
0
 public PointOnInfluenceMap getPointOnProximityMap(Vector2Int position, eFactionName factionName)
 {
     return(m_proximityMaps[(int)factionName].getPoint(position));
 }