public static SalaryInfo GetSalaryCard(this LifeBoardGamePlayerItem thisPlayer)
        {
            SalaryInfo thisCard;

            thisCard = (SalaryInfo)thisPlayer.Hand.Where(items => items.Deck >= 19 && items.Deck <= 27).SingleOrDefault();
            return(thisCard);
        }
 public static void AddPegs(this CarPieceCP thisCar, LifeBoardGamePlayerItem thisPlayer)
 {
     thisCar.AddPeg(thisPlayer.Gender.GetColor());
     if (thisPlayer.Married)
     {
         EnumGender newGender;
         if ((int)thisPlayer.Gender == (int)EnumGender.Boy)
         {
             newGender = EnumGender.Girl;
         }
         else
         {
             newGender = EnumGender.Boy;
         }
         thisCar.AddPeg(newGender.GetColor());
     }
     if (thisPlayer.ChildrenList.Count > 0 && thisPlayer.Married == false)
     {
         throw new BasicBlankException("Must get married before having children");
     }
     foreach (var ThisChild in thisPlayer.ChildrenList)
     {
         thisCar.AddPeg(ThisChild.GetColor());
     }
 }
        public static HouseInfo GetHouseCard(this LifeBoardGamePlayerItem thisPlayer)
        {
            HouseInfo thisCard;

            thisCard = (HouseInfo)thisPlayer.Hand.Where(items => items.Deck >= 10 && items.Deck <= 18).SingleOrDefault();
            return(thisCard);
        }
Ejemplo n.º 4
0
        internal static void FillInfo(LifeBoardGamePlayerItem thisPlayer)
        {
            var career1 = CareerChosen(thisPlayer, out string career2);

            thisPlayer.Career1   = career1;
            thisPlayer.Career2   = career2;
            thisPlayer.HouseName = thisPlayer.GetHouseName();
        }
        public static LifeBaseCard GetStockCard(this LifeBoardGamePlayerItem thisPlayer, int stockNumber)
        {
            int deck;

            deck = 27 + stockNumber;
            return((from items in thisPlayer.Hand
                    where items.Deck == deck
                    select items).Single());
        }
        public static DeckRegularDict <CareerInfo> GetCareerList(this LifeBoardGamePlayerItem thisPlayer)
        {
            var tempList = thisPlayer.Hand.Where(items => items.Deck <= 9).Select(items => items.Deck).ToCustomBasicList();
            DeckRegularDict <CareerInfo> output = new DeckRegularDict <CareerInfo>();

            foreach (var thisItem in tempList)
            {
                output.Add(CardsModule.GetCareerCard(thisItem));
            }
            return(output);
        }
        public static decimal InsuranceCost(this LifeBoardGamePlayerItem thisPlayer)
        {
            HouseInfo thisCard;

            thisCard = thisPlayer.GetHouseCard();
            if (thisCard == null)
            {
                return(0);
            }
            return(thisCard.InsuranceCost);
        }
        public static string GetHouseName(this LifeBoardGamePlayerItem thisPlayer)
        {
            HouseInfo thisCard;

            thisCard = (HouseInfo)thisPlayer.Hand.Where(items => items.Deck >= 10 && items.Deck <= 18).SingleOrDefault();
            if (thisCard == null || thisCard !.Deck == 0)
            {
                return("");
            }
            return(thisCard.HouseCategory.ToString());
        }
 public static decimal TaxesDue(this LifeBoardGamePlayerItem thisPlayer)
 {
     try
     {
         SalaryInfo thisCard;
         thisCard = (SalaryInfo)thisPlayer.Hand.Where(items => items.Deck >= 19 && items.Deck <= 27).SingleOrDefault();
         return(thisCard.TaxesDue);
     }
     catch (Exception)
     {
         throw new BasicBlankException("Must have a salary to pay taxes");
     }
 }
Ejemplo n.º 10
0
        public static string CareerChosen(LifeBoardGamePlayerItem thisPlayer, out string secondCareer)
        {
            secondCareer = ""; //until proven.
            var    tempList = thisPlayer.GetCareerList();
            string output;
            var    thisCareer = tempList.SingleOrDefault(items => items.Career == EnumCareerType.Teacher);

            if (thisCareer != null && thisCareer.Deck > 0)
            {
                output = "Teacher";
                var newCareer = tempList.SingleOrDefault(items => items.Career != EnumCareerType.Teacher);
                if (newCareer != null && newCareer.Deck > 0)
                {
                    secondCareer = newCareer.Career.ToString();
                }
                return(output);
            }
            if (tempList.Count == 0)
            {
                return("");
            }
            return(tempList.Single().Career.ToString());
        }
 public static LifeBaseCard GetBaseHouseCard(this LifeBoardGamePlayerItem thisPlayer)
 {
     return((from Items in thisPlayer.Hand
             where Items.Deck >= 10 && Items.Deck <= 18
             select Items).SingleOrDefault());
 }
 public static decimal NetIncome(this LifeBoardGamePlayerItem thisPlayer)
 {
     return(thisPlayer.MoneyEarned - thisPlayer.Loans);
 }
Ejemplo n.º 13
0
 internal static void ObtainLife(LifeBoardGamePlayerItem thisPlayer)
 {
     thisPlayer.TilesCollected++;
 }
Ejemplo n.º 14
0
 private async Task MoveResultsAsync(int index, LifeBoardGamePlayerItem thisPlayer)
 {
     var thisSpace = _gameContainer !.SpaceList ![index - 1];