示例#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);