Пример #1
0
 public static void AddDropAtPosition(Position position, Drop drop)
 {
     lock (ConsoleAccessObject)
     {
         lock (DropAtPositionDictionaryAccess)
         {
             DropAtPosition.Add(position, drop);
         }
         DisplayModelAtPosition(position, position, drop.GetModel(), Direction.DOWN, false);
     }
 }
Пример #2
0
        public void TrackDrop(Position position, Drop drop)
        {
            int appearTime = drop.GetAppearTime();

            try
            {
                int pom = 1;
                while (appearTime > 0)
                {
                    if (IsPaused)
                    {
                        GameData.PauseGameEvent.Reset();
                        GameData.PauseGameEvent.WaitOne();
                    }

                    Thread.Sleep(1000);
                    appearTime -= 1000;
                    if (appearTime <= 4000)
                    {
                        if (pom == 1)
                        {
                            drop.GetModel().ModelColor = ConsoleColor.White;
                            pom = 0;
                        }
                        else
                        {
                            drop.GetModel().ModelColor = drop.GetModel().ModelBaseColor;
                            pom = 1;
                        }
                        GameData.DisplayModelAtPosition(position, position, drop.GetModel(), 0, false);
                    }
                }
            }
            catch (ThreadInterruptedException)
            {
            }
            GameData.RemoveDropAtPosition(position);
            Pause.Detach(this);
        }
Пример #3
0
 public HealthBonus(Drop drop) : base(drop)
 {
 }
Пример #4
0
 public Bonus(Drop drop)
 {
     this.Drop = drop;
 }
Пример #5
0
 public AmmoBonus(Drop drop) : base(drop)
 {
 }