Пример #1
0
 public Raid(RaidInfo raid)
 {
     this.Time       = DateTime.UtcNow;
     this.RaidInfoId = raid.Id;
     this.Running    = true;
     this.Locked     = false;
 }
        public bool TryFindRaid(string name, out RaidInfo raid)
        {
            raid = RaidInfo.FindFirst(x => x.CommunityId == this.Id && x.Name.ToLower() == name.ToLower());

            if (raid == null)
            {
                return(false);
            }

            return(true);
        }
        public RaidInfo RaidAdd(string name, string description)
        {
            RaidInfo raid;

            if (!TryFindRaid(name, out raid))
            {
                raid = new RaidInfo(this, name, description);
                raid.Save();

                return(raid);
            }
            else
            {
                throw new Exception("Raid already exist with same name.");
            }
        }