Пример #1
0
        public bool IsValidAmenity(string amenityId)
        {
            if (string.IsNullOrEmpty(amenityId))
            {
                return(false);
            }

            if (Property.ContainsKey(amenityId))
            {
                return(true);
            }
            if (Community.ContainsKey(amenityId))
            {
                return(true);
            }

            foreach (var key in OptionsProperties.Keys)
            {
                if (OptionsProperties[key].ContainsKey(amenityId))
                {
                    return(true);
                }
            }
            foreach (var key in OptionsCommunity.Keys)
            {
                if (OptionsCommunity[key].ContainsKey(amenityId))
                {
                    return(true);
                }
            }

            return(false);
        }
            //public void Print(string messag)
            //{
            //    visuals.Output(messag);
            //}

            public new void Add(string friend, string message)
            {
                if (Community.ContainsKey(friend))
                {
                    Community[friend].Add(Name + " : " + message);
                }
                else
                {
                    Add("Friend " + friend + " is not part of the community");
                }
            }
 public new void Poke(string who)
 {
     Add("\r\n");
     if (Community.ContainsKey(who))
     {
         Community[who].Add(Name, "Poked you");
     }
     else
     {
         Add("Friend " + who + " is not part of the community");
     }
 }
Пример #4
0
 /// <summary>
 /// Checks if the community wants a resource.
 /// </summary>
 /// <returns><c>true</c>, if if want was checked, <c>false</c> otherwise.</returns>
 /// <param name="b">The blue component.</param>
 public bool CheckIfWant(string b)
 {
     if (tierreqs [curTier].ContainsKey(b))
     {
         if (!myCommunity.ContainsKey(b))
         {
             return(true);
         }
         if (myCommunity.IsThereAFreeBoi())
         {
             return(!myCommunity.HasGoodsCheck(b, tierreqs [curTier] [b]));
         }
     }
     return(false);
 }