public void AddTempValue(EquipmentStats stats) { var eq = new EqId(stats.Id, stats.Type); if (!IsThisEquipmantInTempValues(stats)) { tempAllowedEquipmentId.Add(eq); } }
public void AllowThisEquipment(EquipmentStats stats) { var eq = new EqId(stats.Id, stats.Type); if (!IsThisEquipmantAllowed(stats)) { allowedEquipmentId.Add(eq); } }
public EqId GetEquipmantAllowed(EquipmentStats stats) { if (!IsThisEquipmantAllowed(stats)) { throw new Exception("Ну ты че. проверь сначала..."); } var eq = new EqId(stats.Id, stats.Type); return(allowedEquipmentId.Find(e => e.Id == eq.Id && e.Type == eq.Type)); }
public EqId(EqId eqid, int?id = null, EquipmentStats.TypeOfEquipment?type = null, bool?isNew = null) { Id = eqid.Id; Type = eqid.Type; IsNew = eqid.IsNew; if (id != null) { Id = id.Value; } if (type != null) { Type = type.Value; } if (isNew != null) { IsNew = isNew.Value; } }
public bool IsThisEquipmantInTempValues(EquipmentStats stats) { var eq = new EqId(stats.Id, stats.Type); return(tempAllowedEquipmentId.FindIndex(e => e.Id == eq.Id && e.Type == eq.Type) >= 0); }