示例#1
0
 TurnInfo saveTurn(Entity selectedEntity, int action, Point2 tileSelected, AIMapInfo mapInfo)
 {
     TurnInfo turnInfo = new TurnInfo();
     List<Point2> affectedTiles = selectedEntity.getEntityActionManager().actions[action].getAffectedTiles(selectedEntity.getCurrentLocation(), tileSelected, mapInfo);
     foreach (Point2 p in affectedTiles)
     {
         turnInfo.addAffectedTile(mapInfo.getTile(p));
     }
     return turnInfo;
 }
示例#2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance  = this;
         maxExtent = mapPosCorner.position;
         minExtent = mapNegCorner.position;
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#3
0
    public override float scoreMap(AIMapInfo aiMapInfo)
    {
        int currentEnemyCount = 0;
        int currentEnemyKingCount = 0;
        int enemyTiles = 0;
        int friendlyTiles = 0;
        float mapScore = 0;
        for (int x = 0; x < MapGenerator.BoardWidth; x++)
        {
            for (int y = 0; y < MapGenerator.BoardHeight; y++)
            {
                Tile tileAtPoint = MapGenerator.getTileAtPoint(x, y);
                if (tileAtPoint.getCurrentEntity() != null && aiMapInfo.checkEntityIsEnemy(tileAtPoint.getCurrentEntity()))
                {
                    if (tileAtPoint.getCurrentEntity() is King)
                    {
                        currentEnemyKingCount++;
                    }
                    currentEnemyCount++;
                }
                if (tileAtPoint.currentTileType == Tile.JANITOR)
                {
                    enemyTiles++;
                }
                if (tileAtPoint.currentTileType == Tile.DEMON)
                {
                    friendlyTiles++;
                }
            }
        }
        if (currentEnemyKingCount <= 0)
        {
            mapScore += 100000;
        }

        mapScore += (5 * (friendlyTiles - aiMapInfo.tilesControlled));
        mapScore += (5 * (aiMapInfo.enemyTilesControlled - enemyTiles));
        mapScore += 30 * (aiMapInfo.getAllEnemyEntities().Count - currentEnemyCount);
        mapScore += scorePosition(aiMapInfo);
        return mapScore;
    }
示例#4
0
 public abstract float scoreMap(AIMapInfo mapInfo);
示例#5
0
    MoveInfo getRandomMove(AIMapInfo aiMapInfo)
    {
        MoveInfo moveInfo = new MoveInfo();

        moveInfo.entity = aiMapInfo.getAllFriendlies()[Random.Range(0, aiMapInfo.getAllFriendlies().Count)];
        EntityActionManager eActionManager = moveInfo.entity.getEntityActionManager();
        moveInfo.actionSelected = Random.Range(0, eActionManager.actions.Length);

        return moveInfo;
    }
示例#6
0
    float scorePosition(AIMapInfo aiMapInfo)
    {
        float totalScore = 0;


        return totalScore;
    }