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; }
public bool RemoveLaw(ILaw law) { lock (lawsLock) { if (laws.Contains(law)) { return(false); } laws.RemoveAll(x => x.Equals(law)); } return(true); }
public bool AddLaw(ILaw law) { lock (lawsLock) { if (laws.Contains(law)) { return(false); } laws.Add(law); } return(true); }
public void AddLaw(ILaw newLaw) { throw new NotImplementedException(); }
public bool ProposeLaw(ILaw law) => throw new NotImplementedException();