Example #1
0
        public void AddBlock(Block block)
        {
            if (block.IsEmpty) // users can't empty blocks!
                return;

            if (!this._blocks[block.Location].IsEmpty)
                return;

            this._blocks[block.Location] = block;
            block.AttachTo(this);
        }
Example #2
0
 public Texture2D GetBlockTexture(Block block)
 {
     switch (block.Color)
     {
         case BlockColor.orange:
             return this.BlockTextures[Color.Orange];
             break;
         case BlockColor.purple:
             return this.BlockTextures[Color.Purple];
             break;
         case BlockColor.green:
             return this.BlockTextures[Color.Green];
             break;
         default:
             return null;
     }
 }