Пример #1
0
 public override void Remove(TileGraphics tileGraphics) => throw new InvalidOperationException("Cannot remove tileGraphics from a StaticTileGraphics");
Пример #2
0
 public virtual void UpdateGfx(TileGraphics tileGraphics)
 {
     this.tileGraphics = tileGraphics;
 }
Пример #3
0
 public override void Add(TileGraphics tileGraphics) => throw new InvalidOperationException("Cannot add tileGraphics to a StaticTileGraphics");
Пример #4
0
 public override void UpdateGfx(TileGraphics tileGraphics)
 {
     base.UpdateGfx(tileGraphics);
 }
Пример #5
0
 public void SetTileGfx(TileGraphics graphics)
 {
     tileGraphics = graphics;
 }
Пример #6
0
 public override void Remove(TileGraphics tileGraphics) => this.frames.Remove(tileGraphics);
Пример #7
0
 public override void Add(TileGraphics tileGraphics) => this.frames.Add(tileGraphics);
Пример #8
0
        public override void UpdateGfx(TileGraphics tileGraphics)
        {
            this.tileGraphics = tileGraphics;



            //switch (tileType)
            //{
            //    case TileTypeEnum.Bomb:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\bomb" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch(Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;
            //    case TileTypeEnum.Crate:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\crate" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Player1:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\player1" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Player2:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\player2" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Player3:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\player3" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Player4:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\player4" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUIncreaseBombCount:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_bombcount_increase" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUDecreaseBombCount:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_bombcount_decrease" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUIncreaseBombRange:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_bombrange_increase" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUDecreaseBombRange:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_bombrange_decrease" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUTemporaryJump:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_jump" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUTemporaryShield:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_shield" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Wall:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\wall" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.DestroyableWall:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\destroyable_wall" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.PUBombKick:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\powerup_bombkick" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Water:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\water" + "_frame" + currentFrame + ".png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;
            //    case TileTypeEnum.Dead:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\dead.png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;
            //    case TileTypeEnum.FlameH:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\flameH.png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;
            //    case TileTypeEnum.FlameV:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\flameV.png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;
            //    case TileTypeEnum.FlameC:
            //        try
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\flameC.png")));
            //        }
            //        catch (Exception ex)
            //        {
            //            tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //            Console.WriteLine(ex.Message);
            //            break;
            //        }
            //        break;

            //    case TileTypeEnum.Empty:
            //    default:
            //        tileGraphics.SetTileGfx(Image.FromFile(Path.Combine(ClientManager.Instance.ProjectPath, "Resources\\empty.png")));
            //        break;
            //}
        }
Пример #9
0
 public abstract void Remove(TileGraphics tileGraphics);
Пример #10
0
 public abstract void Add(TileGraphics tileGraphics);