示例#1
0
            public void propaganda()
            {
                Console.WriteLine("W dzielnicy " + name + " masz respekt");
                GameLog.Add(new Notification("Twój wizerunek w dzielnicy " + name + " znacznie się ocieplił."));
                RefreshNotifications();
                for (int i = 0; i < numFactions; i++)
                {
                    Factions[i].Upset(-members[i] * 0.0008f);
                }

                CityUpdate(1);
            }
示例#2
0
            public void repress()
            {
                Console.WriteLine("W dzielnicy " + name + " cie nie lubia");
                GameLog.Add(new Notification("Jeśli ktokolwiek w dzielnicy " + name + " myślał o buncie, teraz pomyśli dwa razy"));
                RefreshNotifications();
                for (int i = 0; i < numFactions; i++)
                {
                    Factions[i].Upset(members[i] * 0.0004f);
                    Factions[i].Tame(members[i] * 0.0015f);
                }

                CityUpdate(1);
            }
示例#3
0
            public void UpdateEvent()

            {
                countdown--;
                if (countdown == 4)
                {
                    GameLog.Add(new Notification(this));
                }
                else if (countdown == 0)
                {
                    ConductEvent();
                    active = false;
                    GameLog.Add(new Notification(this));
                }
            }
示例#4
0
        public void TrashFromHand(ISupply supply, Card card)
        {
            var cardInHand = Hand.First(x => x == card);
            var instance   = CardFactory.Create(cardInHand);

            Hand.Remove(cardInHand);
            GameLog.Add(PlayerName.Substring(0, 1) + " trashes a " + card);
            supply.AddToTrash(card);

            if (instance is IOnTrashAbilityHolder abilityHolder)
            {
                abilityHolder.ResolveOnTrashAbilities(this);
            }

            RunTriggeredAbilities(PlayerAction.Trash, card);
        }
示例#5
0
文件: Game.cs 项目: djericj/Uno
        private void Log(string stage, Player player, int round, string action)
        {
            var log = new GameTurn()
            {
                Stage          = stage,
                Player         = player,
                Round          = round,
                Action         = action,
                CardsRemaining = player.CardsRemaining,
                Hand           = player.Hand,
                HasUno         = player.Hand != null?player.Hand.Count() == 1 : false,
                FaceCard       = FaceCard
            };

            GameLog.Add(log);
            OnGameTurnCompleted <GameTurn>(log);
        }
示例#6
0
文件: Game.cs 项目: djericj/Uno
        private void Log(string stage, string action)
        {
            var log = new GameTurn()
            {
                Stage          = stage,
                Player         = null,
                Round          = -1,
                Action         = action,
                CardsRemaining = -1,
                Hand           = null,
                HasUno         = false,
                IsWinner       = false,
                FaceCard       = null
            };

            GameLog.Add(log);
            OnGameTurnCompleted <GameTurn>(log);
        }
示例#7
0
            public void solve()
            {
                difficulty -= 5;
                if (difficulty < 0)
                {
                    Factions[suspect].Upset(15f);
                    Factions[victim].Upset(-15f);
                    GameLog.Add(new Notification("Sprawa rozwiązana, ale frakcja " + Factions[suspect].name + " nie jest z tego zadowolona."));
                    //CrimeScene.Remove(this);
                    isactive = false;
                }
                else
                {
                    GameLog.Add(new Notification("Sprawa wymaga dalszej analizy. Frakcja " + Factions[suspect].name + " krzywo patrzy na twoje zaangażowanie."));
                }
                CityUpdate(1);

                Mechanics.RefreshNotifications();
            }
示例#8
0
        public void TestSerializeGameLog()
        {
            var log = new GameLog();

            log.Add(2, 5, 0, new InputParseTest.Spawn());

            using (var stream = new MemoryStream())
            {
                var serializer = new Serializer();
                stream.Write(serializer.Data, 0, serializer.Length);
                log.WriteTo(stream);

                stream.Position = 0;
                var deserializer = new Deserializer(stream.GetBuffer());
                using (var stream2 = new MemoryStream(deserializer.GetRemainingBytes()))
                {
                    var result = GameLog.ReadFrom(stream2).InputLog;
                    result.Keys.Any(u => u != 2).ShouldBeFalse();
                }
            }
        }
示例#9
0
 //GameLog for user
 public void AddGameLog(string str)
 {
     Debug.Log("AddGameLog : " + str);
     gameLog.Add(str);
 }
示例#10
0
 public void Discard(Card card)
 {
     GameLog.Add(PlayerName.Substring(0, 1) + " discards a " + card.ToString());
     DiscardPile.Add(card);
 }
示例#11
0
 public void AddGameLog(string str)
 {
     gameLog.Add(str);
 }