public override UrbComponentData GetComponentData() { UrbComponentData Data = base.GetComponentData(); Data.Fields = new UrbFieldData[] { new UrbFieldData { Name = "Height", Value = Height } }; UrbSubstance[] BodyContents = (BodyComposition == null)? BodyRecipe : BodyComposition.GetCompositionIngredients(); Data.FieldArrays = new UrbFieldArrayData[] { UrbEncoder.GetArrayFromSubstances("BodyRecipe", BodyRecipe), UrbEncoder.GetArrayFromSubstances("BodyContents", BodyContents), UrbEncoder.GetArrayFromSubstances("CriticalBodyPartAmounts", CriticalBodyPartAmounts), }; Data.StringArrays = new UrbStringArrayData[] { UrbEncoder.EnumsToArray("SkinRecipe", SkinRecipe), }; return(Data); }
public override UrbComponentData GetComponentData() { UrbComponentData Data = new UrbComponentData { Type = this.GetType().ToString(), }; Data.Fields = new UrbFieldData[] { new UrbFieldData { Name = "MateRequirement", Value = MateRequirement }, new UrbFieldData { Name = "MateCrowding", Value = MateCrowding }, new UrbFieldData { Name = "OffspringCount", Value = OffspringCount }, new UrbFieldData { Name = "OffspringRequiredSpace", Value = OffspringRequiredSpace }, new UrbFieldData { Name = "DispersalDistance", Value = DispersalDistance }, new UrbFieldData { Name = "Gestation", Value = Gestation }, new UrbFieldData { Name = "Gestating", Value = (Gestating)? 1 : 0 }, }; Data.Strings = new UrbStringData[] { new UrbStringData { Name = "BreedType", Value = BreedType.ToString() }, new UrbStringData { Name = "RequiredOffspringTerrain", Value = RequiredOffspringTerrain.ToString() } }; Data.StringArrays = new UrbStringArrayData[] { UrbEncoder.EnumsToArray <UrbScentTag>("MateScents", MateScents), UrbEncoder.EnumsToArray <UrbScentTag>("RivalScents", RivalScents), UrbEncoder.ObjectsDataToArray("OffspringData", OffspringData) }; Data.FieldArrays = new UrbFieldArrayData[] { UrbEncoder.GetArrayFromSubstances("GestationRecipe", GestationRecipe) }; return(Data); }
public override UrbComponentData GetComponentData() { UrbComponentData Data = base.GetComponentData(); UrbSubstance[] StomachContents = (Stomach == null)? new UrbSubstance[0] : Stomach.GetCompositionIngredients(); Data.FieldArrays = new UrbFieldArrayData[] { UrbEncoder.GetArrayFromSubstances("StomachContents", StomachContents), }; Data.StringArrays = new UrbStringArrayData[] { UrbEncoder.EnumsToArray("FoodSubstances", FoodSubstances), UrbEncoder.EnumsToArray("FoodScents", FoodScents) }; return(Data); }