Ejemplo n.º 1
0
        public void AddLaw(ILaw newLaw)
        {
            var alredyHas = Laws.FirstOrDefault(lw => lw.Name == newLaw.Name);

            if (alredyHas != null)
            {
                throw new KeyNotFoundException("Такой закон уже тут есть!");
            }

            Laws.Add(newLaw);
            newLaw.Owner = this;
        }
Ejemplo n.º 2
0
        public bool RemoveLaw(ILaw law)
        {
            lock (lawsLock)
            {
                if (laws.Contains(law))
                {
                    return(false);
                }

                laws.RemoveAll(x => x.Equals(law));
            }

            return(true);
        }
Ejemplo n.º 3
0
        public bool AddLaw(ILaw law)
        {
            lock (lawsLock)
            {
                if (laws.Contains(law))
                {
                    return(false);
                }

                laws.Add(law);
            }

            return(true);
        }
Ejemplo n.º 4
0
 public void AddLaw(ILaw newLaw)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public bool ProposeLaw(ILaw law) => throw new NotImplementedException();