public void MapGrid(Grid grid, GridData gridData)
        {
            foreach (var blockData in gridData.Blocks)
            {
                var blockType = BlockTypes.GetBlockType(blockData.BlockTypeId);

                var block = blockType.Load(this, new DictionaryAccess(blockData.Data));

                grid.SetBlock(blockData.Position, block);
            }
        }
Exemple #2
0
 // Those methods looks up what class should serve this request, and forwards it
 // Note: remember this was supposed  to be a struct...
 public bool IsSolid()
 {
     return(BlockTypes.GetBlockType(_type).IsSolid(this));
 }
Exemple #3
0
 public bool Create(BlockType type)
 {
     return(BlockTypes.GetBlockType(_type).Create(this, type));
 }
Exemple #4
0
 public bool Destroy()
 {
     return(BlockTypes.GetBlockType(_type).Destroy(this));
 }
Exemple #5
0
 public Vector2 TextureUV()
 {
     return(BlockTypes.GetBlockType(_type).TextureUV(this));
 }
Exemple #6
0
 public void OnActivate(Block block, int x, int y, int z)
 {
     BlockTypes.GetBlockType(type).OnActivate(this, x, y, z);
 }
Exemple #7
0
 public Vector2 tex()
 {
     return(BlockTypes.GetBlockType(type).tex(this));
 }
Exemple #8
0
 public bool isSolid()
 {
     return(BlockTypes.GetBlockType(type).isSolid(this));
 }