示例#1
0
        public LogicCell CellFromBytes()
        {
            LogicCell cell = null;

            switch ((CellType)m_cellType.Value)
            {
            case CellType.CELL_WALL:
                cell = CreateFromBytes <WallCell>(m_logicCellBytes.Value.ArraySegment());
                break;

            case CellType.CELL_FLOOR:
                cell = CreateFromBytes <FloorCell>(m_logicCellBytes.Value.ArraySegment());
                break;

            case CellType.CELL_DOOR:
                cell = CreateFromBytes <DoorCell>(m_logicCellBytes.Value.ArraySegment());
                break;

            case CellType.CELL_BUTTON:
                cell = CreateFromBytes <DoorButtonCell>(m_logicCellBytes.Value.ArraySegment());
                break;

            case CellType.CELL_PLAYERSPAWN:
                cell = CreateFromBytes <PlayerSpawnCell>(m_logicCellBytes.Value.ArraySegment());
                break;

            case CellType.CELL_NONE:
                break;

            default:
                break;
            }
            return(cell);
        }
示例#2
0
        public CellInfo(LogicCell parentCell)
        {
            if (parentCell != null)
            {
                m_cellType       = new serialization.types.Byte((byte)parentCell.GetCellType());
                m_logicCellBytes = new serialization.types.ByteArray(parentCell.GetBytes());
            }
            else
            {
                m_cellType       = new serialization.types.Byte((byte)CellType.CELL_NONE);
                m_logicCellBytes = new serialization.types.ByteArray(new byte[0]);
            }

            InitSerializableMembers(m_cellType, m_logicCellBytes);
        }
示例#3
0
 public LogicGrid(int x, int y) : base()
 {
     Grid   = new cellType.LogicCell[x, y];
     Width  = x;
     Height = y;
 }