public virtual void Command(Direction.Cube direction, int[][] _cubesOccup)
    {
        if (!this.hasInteraction)
        {
            return;
        }

        this.hasInteraction = false;

        Dictionary <string, int> newPosInfo = Cubes.GetCubeNewPos(this.curPos, _cubesOccup, direction);

        int[] oldMatrixPos = new int[] {
            newPosInfo["y"],
            newPosInfo["x"]
        };

        int[] newMatrixPos = new int[] {
            newPosInfo["newY"],
            newPosInfo["newX"]
        };

        manager.SwitchMatrixValue(oldMatrixPos, 0);
        manager.SwitchMatrixValue(newMatrixPos, newPosInfo["cubeID"]);

        CubeAction(newMatrixPos);
    }
Esempio n. 2
0
 public override void SetUpCube(int[] pos, CubesController manager)
 {
     base.SetUpCube(pos, manager);
     manager.SwitchMatrixValue(pos, -1);
 }