Beispiel #1
0
        public bool Invent(Player pPlayer, Invention pInvention)
        {
            if (State == GameState.Invent)
            {
                //pPlayer.PlayInvention(pInvention);
                pPlayer.SelectInvention(pInvention);
                if (CheckEverybodyDoInvent())
                {
                    inventEvt.Set();
                }
            }
            else if (State == GameState.Inventing)
            {
                if (pPlayer.CurrentEffect == null || pPlayer.CurrentEffect.Dir != EffectDirection.Drop || pPlayer.CurrentEffect.It != EffectItem.Invention)
                {
                    Console.WriteLine($"{pPlayer.Name} дропает изобретение не в тот ход");
                    return(false);
                }
                pPlayer.SelectInvention(pInvention); //TODO union with invent state

                effectEvt.Set();
            }
            else
            {
                Console.WriteLine($"{pPlayer.Name} Invent не в свой ход");
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        public bool DropInvention(Invention pInvention)
        {
            if (!Inventions.Contains(pInvention))
            {
                Console.WriteLine("You haven't got this invention! Cheater?");
                return(false);
            }

            Inventions.Remove(pInvention);
            Console.WriteLine($"{Name} изобрёл [{pInvention.ID}]{pInvention.Name}");

            return(true);
        }
Beispiel #3
0
        public bool SelectInvention(Invention pInvention)
        {
            CurrentInvention = pInvention;

            return(true);
        }