/// <summary> /// Fills a data object with data from a data row /// </summary> /// <param name="dr">the data row to fill from</param> public override void Fill(DataRow dr) { ID = DataUtility.GetFromDataRow <long>(dr, "ID"); Created = DataUtility.GetFromDataRow <DateTime>(dr, "Created"); LastRevised = DataUtility.GetFromDataRow <DateTime>(dr, "LastRevised"); Name = DataUtility.GetFromDataRow <string>(dr, "Name"); ToLocationID = DataUtility.GetFromDataRow <string>(dr, "ToLocationID"); FromLocationID = DataUtility.GetFromDataRow <string>(dr, "FromLocationID"); ToLocationType = DataUtility.GetFromDataRow <string>(dr, "ToLocationType"); FromLocationType = DataUtility.GetFromDataRow <string>(dr, "FromLocationType"); MessageToDestination = DataUtility.GetFromDataRow <string>(dr, "MessageToDestination"); MessageToOrigin = DataUtility.GetFromDataRow <string>(dr, "MessageToOrigin"); MessageToActor = DataUtility.GetFromDataRow <string>(dr, "MessageToActor"); AudibleToSurroundings = DataUtility.GetFromDataRow <string>(dr, "AudibleToSurroundings"); VisibleToSurroundings = DataUtility.GetFromDataRow <string>(dr, "VisibleToSurroundings"); AudibleStrength = DataUtility.GetFromDataRow <int>(dr, "AudibleStrength"); VisibleStrength = DataUtility.GetFromDataRow <int>(dr, "VisibleStrength"); Model = new DimensionalModel(dr); }
/// <summary> /// Fills a data object with data from a data row /// </summary> /// <param name="dr">the data row to fill from</param> public override void Fill(DataRow dr) { ID = DataUtility.GetFromDataRow<long>(dr, "ID"); Created = DataUtility.GetFromDataRow<DateTime>(dr, "Created"); LastRevised = DataUtility.GetFromDataRow<DateTime>(dr, "LastRevised"); Name = DataUtility.GetFromDataRow<string>(dr, "Name"); string mobileContainerJson = DataUtility.GetFromDataRow<string>(dr, "MobileContainers"); dynamic mobileContainers = JsonConvert.DeserializeObject(mobileContainerJson); foreach(dynamic mobileContainer in mobileContainers) { var newContainer = new EntityContainerData<IMobile>(); newContainer.CapacityVolume = mobileContainer.CapacityVolume; newContainer.CapacityWeight = mobileContainer.CapacityWeight; newContainer.Name = mobileContainer.Name; MobileContainers.Add(newContainer); } string inanimateContainerJson = DataUtility.GetFromDataRow<string>(dr, "InanimateContainers"); dynamic inanimateContainers = JsonConvert.DeserializeObject(inanimateContainerJson); foreach (dynamic inanimateContainer in inanimateContainers) { var newContainer = new EntityContainerData<IInanimate>(); newContainer.CapacityVolume = inanimateContainer.CapacityVolume; newContainer.CapacityWeight = inanimateContainer.CapacityWeight; newContainer.Name = inanimateContainer.Name; InanimateContainers.Add(newContainer); } string internalCompositionJson = DataUtility.GetFromDataRow<string>(dr, "InternalComposition"); InternalComposition = DeserializeInternalCompositions(internalCompositionJson); Model = new DimensionalModel(dr); }