Exemplo n.º 1
0
    public List <AIRawSlimeAction> GetConquerActions(RawSlime slime)
    {
        // Devolvemos la accion de conquerir el terreno sobre el que esta esa slime
        List <AIRawSlimeAction> actions = new List <AIRawSlimeAction>();

        // Si no l'ha conquerit ja, pot conquerirla.
        if (!slime.GetPlayer().GetConqueredTiles().Contains(slime.GetActualTile()))
        {
            actions.Add(new AIRawSlimeAction(slime.GetId(), ActionType.CONQUER, slime.GetActualTile().getPosition()));
        }
        else if (slime.canGrow)
        {
            actions.Add(new AIRawSlimeAction(slime.GetId(), ActionType.EAT, slime.GetId()));
        }
        return(actions);
    }
Exemplo n.º 2
0
    public List <AIRawSlimeAction> GetFusionActions(RawSlime slime)
    {
        // Devolvemos las acciones de fusionarse que puede hacer con esa slime
        List <AIRawSlimeAction> actions = new List <AIRawSlimeAction>();

        foreach (RawSlime sl in GetFusionTargets(slime))
        {
            actions.Add(new AIRawSlimeAction(slime.GetId(), ActionType.FUSION, sl.GetId()));
        }
        return(actions);
    }
Exemplo n.º 3
0
    public List <AIRawSlimeAction> GetMoveActions(RawSlime slime)
    {
        // Devolvemos las acciones de movimiento que puede hacer esa slime
        List <AIRawSlimeAction> actions = new List <AIRawSlimeAction>();

        foreach (TileData tile in GetPossibleMovements(slime))
        {
            actions.Add(new AIRawSlimeAction(slime.GetId(), ActionType.MOVE, tile.getPosition()));
        }
        return(actions);
    }
Exemplo n.º 4
0
    public List <AIRawSlimeAction> GetSplitActions(RawSlime slime)
    {
        // Devolvemos las acciones de dividirse que puede hacer con esa slime
        List <AIRawSlimeAction> actions = new List <AIRawSlimeAction>();

        if (slime.canSplit)
        {
            foreach (TileData tile in GetSplitRangeTiles(slime))
            {
                actions.Add(new AIRawSlimeAction(slime.GetId(), ActionType.SPLIT, tile.getPosition()));
            }
        }
        return(actions);
    }
Exemplo n.º 5
0
    public List <AIRawSlimeAction> GetAttackActions(RawSlime slime)
    {
        // Devolvemos las acciones que puede hacer para atacar a otro jugador con ESA slime
        List <AIRawSlimeAction> actions = new List <AIRawSlimeAction>();

        if (slime.canAttack)
        {
            foreach (RawSlime toAttack in GetSlimesInAttackRange(slime))
            {
                actions.Add(new AIRawSlimeAction(slime.GetId(), ActionType.ATTACK, toAttack.GetId()));
            }
        }
        return(actions);
    }