Ejemplo n.º 1
0
 public ESCPlayer(ESCMaze m)
 {
     dice           = new ESCDice();
     maze           = m;
     currentRoom    = m.Entrance;
     siblingActions = new Dictionary <ESCRoom.RoomDirection, List <ActionType> >();
 }
Ejemplo n.º 2
0
    void GemTest()
    {
        ESCMaze Maze;
        int     PlayersCount = 5;

        Maze = new ESCMaze();

        for (var i = 0; i < PlayersCount; i++)
        {
            PlayerList.Add(new ESCPlayer(Maze));
        }

        PlayerList[0].Turn();
        Print(0);
        // public void PerformAction(ESCRoom.RoomDirection dir, ActionType action, int playerId)
        PlayerList[0].PerformAction(ESCRoom.RoomDirection.Left, ActionType.Discover, -1);
        Debug.Log("TYPE : " + PlayerList[0].currentRoom.Siblings[ESCRoom.RoomDirection.Left].type.ToString());
        PlayerList[0].PerformAction(ESCRoom.RoomDirection.Left, ActionType.Move, -1);
        PlayerList[0].Turn();
        Print(0);
    }
Ejemplo n.º 3
0
    public ESCCondition(ESCMaze m, ConditionType conditionType)
    {
        maze = m;
        type = conditionType;

        Symbol.SymbolType lockCondition = Symbol.RollLockCondition();
        switch (type)
        {
        case ConditionType.Discover:
            conditionElements = new Symbol.SymbolType[2] {
                Symbol.SymbolType.Human, Symbol.SymbolType.Human
            };
            break;

        case ConditionType.Enter:
            conditionElements = new Symbol.SymbolType[2];
            for (var i = 0; i < 2; i++)
            {
                conditionElements[i] = Symbol.RollCondition();
            }
            break;

        case ConditionType.MinorLock:
        case ConditionType.BigLock:
            conditionElements = new Symbol.SymbolType[4];
            for (var i = 0; i < 4; i++)
            {
                conditionElements[i] = lockCondition;
            }
            break;

        case ConditionType.Exit:
            conditionElements = CalcExitCondition();
            break;
        }
    }
Ejemplo n.º 4
0
    public ESCRoom(ESCMaze m, RoomType roomType)
    {
        maze           = m;
        type           = roomType;
        EnterCondition = new ESCCondition(maze, ESCCondition.ConditionType.Enter);
        SiblingsAlive  = 0;

        Siblings = new Dictionary <RoomDirection, ESCRoom>();
        switch (roomType)
        {
        case RoomType.Entrance:
            Siblings = new Dictionary <RoomDirection, ESCRoom>()
            {
                { RoomDirection.Left, null },
                { RoomDirection.Right, null }
            };
            InnerCondition = null;
            break;

        case RoomType.Normal:
            InnerCondition = null;
            break;

        case RoomType.MinorLock:
            InnerCondition = new ESCCondition(maze, ESCCondition.ConditionType.MinorLock);
            break;

        case RoomType.BigLock:
            InnerCondition = new ESCCondition(maze, ESCCondition.ConditionType.BigLock);
            break;

        case RoomType.Exit:
            InnerCondition = new ESCCondition(maze, ESCCondition.ConditionType.Exit);
            break;
        }
    }