//** GetPropSlotRecord ** //Return record of a selected prop slot public BodyPropsSlots GetPropSlotRecord(int idSlot, int bodyStruct) { BodyPropsSlots recReturn = new BodyPropsSlots(); recReturn = propSlots.Find(x => x.IDStructure == bodyStruct && x.IDSlot == idSlot); return(recReturn); }
//** AddPropSlot ** //Insert new slot for prop public int AddPropSlot(int idStructure, string partName, string objName) { int iReturn = 1; //Get number of new record if (propSlots.Count(x => x.IDStructure == idStructure) > 0) { iReturn = propSlots.OrderBy(x => x.IDSlot).Where(x => x.IDStructure == idStructure).Last().IDSlot + 1; } BodyPropsSlots toAdd = new BodyPropsSlots(); toAdd.IDStructure = idStructure; toAdd.SlotName = partName; toAdd.ObjectName = objName; toAdd.IDSlot = iReturn; propSlots.Add(toAdd); return(iReturn); }