Exemplo n.º 1
0
        public void drawBlock(GraphicsDevice _GraphicsDevice, SpriteBatch _SpriteBatch)
        {
            Vector2 var_DrawPosition = new Vector2(this.Position.X, this.Position.Y);

            Color var_Color = Color.White;

            if (Setting.Setting.debugMode)
            {
                if (this.objects.Count > 0)
                {
                    var_Color = Color.Green;
                }
                else
                {
                    var_Color = this.drawColor;
                }
            }

            String var_RegionType = ((Region.Region) this.Parent.Parent).RegionEnum.ToString();

            String var_TexturePath = "Region/" + var_RegionType + "/" + var_RegionType;

            /*for(int i = 0; i < this.height; i++)
             * {
             *  _SpriteBatch.Draw(Ressourcen.RessourcenManager.ressourcenManager.Texture["Region/" + var_RegionType + "/Block/" + "Wall"], var_DrawPosition - new Vector2(0, BlockSize * i), var_Color);
             * }*/

            BlockLayerEnum var_Layer = BlockLayerEnum.Layer1;

            while ((int)var_Layer < this.layer.Length)
            {
                BlockEnum var_Enum = this.layer[(int)var_Layer];
                if (var_Enum != BlockEnum.Nothing)
                {
                    _SpriteBatch.Draw(Ressourcen.RessourcenManager.ressourcenManager.Texture[var_TexturePath], var_DrawPosition, new Rectangle((int)(var_Enum - 1) * BlockSize, (int)(var_Layer) * BlockSize, BlockSize, BlockSize), var_Color);
                }
                var_Layer += 1;
            }
        }
Exemplo n.º 2
0
        public void setLayerAt(Enum _Enum, BlockLayerEnum _Id)
        {
            int x = (int)_Id;

            this.layer[(int)_Id] = (BlockEnum)_Enum;
        }
Exemplo n.º 3
0
 public void setLayerAt(Enum _Enum, BlockLayerEnum _Id)
 {
     int x = (int)_Id;
     this.layer[(int)_Id] = (BlockEnum)_Enum;
 }