Exemple #1
0
 public Matrix(int row, int column)
 {
     Score     = 0;
     matrix    = new T[row, column];
     Direction = NodeMoveDirection.Null;
     for (int x = 0; x < row; x++)
     {
         for (int y = 0; y < column; y++)
         {
             matrix[x, y] = null == default(T) ? new T() : default(T);
         } // end for
     }     // end for
 }         // end Matrix
Exemple #2
0
    public static Vector3 ToVector3(this NodeMoveDirection dir)
    {
        switch (dir)
        {
        case NodeMoveDirection.Up: return(Vector3.up);

        case NodeMoveDirection.Down: return(Vector3.down);

        case NodeMoveDirection.Left: return(Vector3.left);

        case NodeMoveDirection.Right: return(Vector3.right);
        } // end switch
        return(Vector3.zero);
    }