예제 #1
0
        private void DoEvents()
        {
            foreach (var newEvent in gameState.NewEvents)
            {
                MineGame.WriteLine(newEvent.Message + Environment.NewLine, PcmColor.Green, null, GameConsoles.Events);
                gameState.EventsHistory.Add(new EventLog
                {
                    Name        = newEvent.Name,
                    Description = newEvent.Description,
                    Processed   = DateTime.Now.ToString()
                });
            }

            gameState.NewEvents.Clear();
        }
예제 #2
0
 public static void ApplyReward(IAchievementReward reward)
 {
     if (reward is NewStoreItemReward)
     {
         var newStoreItemReward = reward as NewStoreItemReward;
         var gameItem           = Game.Gateway.GameItems.GetAll().First(x => x.Id == reward.GameItemId);
         potatoChipGame.GameState.Store.StoreState.ItemsForSale.Add(
             new StoreItem
         {
             Price = newStoreItemReward.Price,
             Count = newStoreItemReward.Count,
             Item  = gameItem,
         });
         Game.WriteLine($"*** A new item is for sale at the store [{gameItem.Name}]", PcmColor.Green, null, GameConsoles.Events);
         Game.WriteLine(gameItem.Description, PcmColor.Green, null, GameConsoles.Events);
     }
 }