Example #1
0
        public void CampFireOff()
        {
            SetUp();
            Map.Init();
            var campFire = new CampFire();

            CampFire.health -= 1000;
            Assert.IsFalse(CampFire.DeterminStatus());
        }
Example #2
0
        private void DrawFire(Graphics g, int deltaX, int deltaY)
        {
            for (var i = 1; i < Map.mapWidth - 1; i++)
            {
                for (var j = 1; j < Map.mapHeight - 1; j++)
                {
                    if (Map.map[i, j].campfire)
                    {
                        if (CampFire.DeterminStatus())
                        {
                            switch (CampFire.FlameStutus)
                            {
                            case 0:
                                g.DrawImage(fire1, new Rectangle(
                                                new Point(i * Map.mapCell + deltaX, j * Map.mapCell + deltaY),
                                                new Size(Map.mapCell, Map.mapCell)), 0, 0, 60, 60, GraphicsUnit.Pixel);
                                break;

                            case 1:
                                g.DrawImage(fire2, new Rectangle(
                                                new Point(i * Map.mapCell + deltaX, j * Map.mapCell + deltaY),
                                                new Size(Map.mapCell, Map.mapCell)), 0, 0, 60, 60, GraphicsUnit.Pixel);
                                break;

                            case 2:
                                g.DrawImage(fire3, new Rectangle(
                                                new Point(i * Map.mapCell + deltaX, j * Map.mapCell + deltaY),
                                                new Size(Map.mapCell, Map.mapCell)), 0, 0, 60, 60, GraphicsUnit.Pixel);
                                break;

                            case 3:
                                g.DrawImage(fire2, new Rectangle(
                                                new Point(i * Map.mapCell + deltaX, j * Map.mapCell + deltaY),
                                                new Size(Map.mapCell, Map.mapCell)), 0, 0, 60, 60, GraphicsUnit.Pixel);
                                break;
                            }
                        }
                        else
                        {
                            g.DrawImage(nofire, new Rectangle(new Point(i * Map.mapCell + deltaX, j * Map.mapCell + deltaY),
                                                              new Size(Map.mapCell, Map.mapCell)), 0, 0, 60, 60, GraphicsUnit.Pixel);
                        }
                    }
                }
            }
        }
Example #3
0
 public void UpdateFire(object sender, EventArgs e)
 {
     CampFire.NewFlameStutus();
 }