public char GetViewBlock(SkinBlock skin)
        {
            char resultView = ' ';

            switch (skin)
            {
            case SkinBlock.Brick:
                resultView = ConstantValue.BRICK_BLOCK;
                break;

            case SkinBlock.Metal:
                resultView = ConstantValue.METAL_BLOCK;
                break;

            case SkinBlock.Grass:
                resultView = ConstantValue.GRASS_BLOCK;
                break;

            case SkinBlock.Ice:
                resultView = ConstantValue.ICE_BLOCK;
                break;
            }

            return(resultView);
        }
 public Block(Coordinate position, ColorSkin color, SkinBlock skin,
              IField owner, char viewSkin = ConstantValue.BLOCK)
     : base(position, color, owner)
 {
     _skin     = skin;
     _charSkin = viewSkin;
 }
示例#3
0
 public IceBlock(Coordinate position, IField owner,
                 ColorSkin color = ConstantValue.COLOR_ICE_BLOCK,
                 SkinBlock skin  = SkinBlock.Ice,
                 char charSkin   = ConstantValue.ICE_BLOCK)
     : base(position, color, skin, owner, charSkin)
 {
 }
 public MetalBlock(Coordinate position, IField owner,
                   ColorSkin color = ConstantValue.COLOR_METAL_BLOCK,
                   SkinBlock skin  = SkinBlock.Metal,
                   char charSkin   = ConstantValue.METAL_BLOCK)
     : base(position, color, skin, owner, charSkin)
 {
 }
        public void BlockConstruction(int strRow, int strCol, int numWidth,
                                      int numHeight, int shift, SkinBlock skin)
        {
            for (int numBlockC = 0; numBlockC < numWidth; numBlockC++)
            {
                int col = strCol + numBlockC * ConstantValue.HEIGHT_BLOCK * shift;

                for (int numBlockR = 0; numBlockR < numHeight; numBlockR++)
                {
                    int row = strRow + numBlockR * ConstantValue.WIDTH_BLOCK;

                    Coordinate blockCoor = new Coordinate(row, col);

                    switch (skin)
                    {
                    case SkinBlock.Brick:
                        (new BrickBlock(blockCoor, _field)).CreateBlock();
                        break;

                    case SkinBlock.Metal:
                        (new MetalBlock(blockCoor, _field)).CreateBlock();
                        break;

                    case SkinBlock.Grass:
                        (new GrassBlock(blockCoor, _field)).CreateBlock();
                        break;

                    case SkinBlock.Ice:
                        (new IceBlock(blockCoor, _field)).CreateBlock();
                        break;
                    }
                }
            }
        }
 public GrassBlock(Coordinate position, IField owner,
                   ColorSkin color = ConstantValue.COLOR_GRASS_BLOCK,
                   SkinBlock skin  = SkinBlock.Grass,
                   char charSkin   = ConstantValue.GRASS_BLOCK)
     : base(position, color, skin, owner, charSkin)
 {
 }
示例#7
0
 public BrickBlock(Coordinate position, IField owner,
                   ColorSkin color = ConstantValue.COLOR_BRICK_BLOCK,
                   SkinBlock skin  = SkinBlock.Brick, char charSkin = ConstantValue.BRICK_BLOCK)
     : base(position, color, skin, owner, charSkin)
 {
 }