コード例 #1
0
 public void PurchasePerk(Company company, Perk perk)
 {
     throw new NotImplementedException();
 }
コード例 #2
0
 public void SellPerk(Company company, Perk perk, int count)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
ファイル: Company.cs プロジェクト: hyjynx-studios/bizio
        /// <summary>
        /// Finds or creates an this company's record of the given perk.
        /// </summary>
        /// <param name="perk">The perk to find.</param>
        /// <returns>A CompanyPerk that represents the requested perk.</returns>
        public CompanyPerk GetPerk(Perk perk)
        {
            var output = Perks.FirstOrDefault(p => p.Perk == perk);

            if(output == null)
            {
                output = new CompanyPerk
                {
                    Perk = perk,
                    Count = 0
                };

                Perks.Add(output);
            }

            return output;
        }