public void LateBuildUp(NetInfo info, NetInfoVersion version) { if (version == NetInfoVersion.Bridge) { foreach (var building in BuildingCollection.FindObjectsOfType <BuildingInfo>()) { if (building.name.ToLower().Contains("pillar")) { Debug.Log($"PILLARNAME = {building.name}"); } } var bridgePillar = PrefabCollection <BuildingInfo> .FindLoaded($"{Tools.PackageName("BridgePillar")}.CableStay32m_Data"); if (bridgePillar == null) { Debug.Log($"{info.name}: CableStay32m Pillar not found!"); } else { var bridgeAI = info.GetComponent <RoadBridgeAI>(); if (bridgeAI != null) { bridgeAI.m_doubleLength = true; bridgeAI.m_bridgePillarInfo = null; bridgeAI.m_middlePillarInfo = bridgePillar; bridgeAI.m_middlePillarOffset = 58; } } } }
public override void Initialization() { buildings = new BuildingCollection(initNode.GetNode("buildings"), categories.buildings, GetContext(), new BuildingDataSource(description.GetNode().GetNode("buildings"), GetContext())); AddChild(buildings); buildings.Attach(categories.buildings.complete, OnBuildingComplete); }
public Farm() { Buildings = new BuildingCollection(this); CollideCollection = new CollideCollection(this); Money = FarmOptions.DefaultMoney; Player = new Player(this); }
public SeedStorage(BuildingCollection ctx, IStorageFactory factory, Vector posVector) { CtxCollection = ctx; PosVector = posVector; Factory = factory; Capacity = FarmOptions.DefaultSeedCapacity; MaxCapacity = FarmOptions.DefaultSeedMaxCapacity; }
public EggStorage(BuildingCollection ctx, IStorageFactory factory, Vector posVector) { CtxCollection = ctx; Factory = factory; PosVector = posVector; Capacity = FarmOptions.DefaultEggCapacity; MaxCapacity = FarmOptions.DefaultEggMaxCapacity; }
public VegetableStorage(BuildingCollection ctx, IStorageFactory factory, Vector posVector) { CtxCollection = ctx; PosVector = posVector; Factory = factory; Capacity = FarmOptions.DefaultVegetableCapacity; MaxCapacity = FarmOptions.DefaultVegetableMaxCapacity; }
static void UpdateBuildingCollection(string name, Array keptPrefabs, string[] replacedNames) { BuildingCollection c = GameObject.Find(name)?.GetComponent <BuildingCollection>(); if (c != null) { c.m_prefabs = keptPrefabs as BuildingInfo[]; if (replacedNames != null) { c.m_replacedNames = replacedNames; } } }
public void CanSerializeModelBaseAndCollectionAsModel() { var b1 = new Building { Name = "B1" }; b1.Floors.Add(new Floor { Name = "F1" }); b1.Floors.Add(new Floor { Name = "F2" }); b1.Floors.Add(new Floor { Name = "F3" }); var b2 = new Building { Name = "B2" }; var b3 = new Building { Name = "B3" }; var bc = new BuildingCollection(); bc.Add(b1); bc.Add(b2); bc.Add(b3); TestSerializationOnAllSerializers((serializer, config, description) => { var deserializedObject = SerializationTestHelper.SerializeAndDeserialize(bc, serializer, config); Assert.AreEqual(bc.Count, deserializedObject.Count, description); Assert.AreEqual(3, deserializedObject.Count, description); Assert.AreEqual("B1", deserializedObject[0].Name, description); Assert.AreEqual("F1", deserializedObject[0].Floors[0].Name, description); Assert.AreEqual("F2", deserializedObject[0].Floors[1].Name, description); Assert.AreEqual("F3", deserializedObject[0].Floors[2].Name, description); Assert.AreEqual("B2", deserializedObject[1].Name, description); Assert.AreEqual("B3", deserializedObject[2].Name, description); }); }
public IBuilding Create(BuildingCollection ctx, Vector posVector) { NbrBuilt++; return(new Builder(ctx, this, posVector)); }
private void Awake() { collection = Resources.Load <BuildingCollection>("BuildingCollection"); PopulateList(); }
public Builder(BuildingCollection ctxCollection, IBuildingFactory factory, Vector posVector) { CtxCollection = ctxCollection; Factory = factory; PosVector = posVector; }
public ChickenStore(BuildingCollection ctxCollection, IBuildingFactory factory, Vector posVector) { CtxCollection = ctxCollection; Factory = factory; PosVector = posVector; }
public IBuilding Create(BuildingCollection ctx, Vector posVector) { NbrBuilt++; return(new VegetableStorage(ctx, this, posVector)); }
public IEnumerable <Building> GetBuilding(string id) { var getBuilding = BuildingCollection.Find(it => it.id == id).ToList(); return(getBuilding); }
public void AddBuilding([FromBody] Building newBuilding) { newBuilding.id = Guid.NewGuid().ToString(); BuildingCollection.InsertOne(newBuilding); }
public IEnumerable <Building> GetAllBuilding() { var buildingAll = BuildingCollection.Find(bl => true).ToList(); return(buildingAll); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { /// input / output parameters ///List<GH_Guid> GH_guids = new List<GH_Guid>(); ////List<Guid> guids = new List<Guid>(); List <string> Rhino_buildings = new List <string>(); Boolean run = false; string filepath = ""; string output = ""; ///import data if (!DA.GetData("File path", ref filepath)) { return; } if (!DA.GetDataList("Guid", Rhino_buildings)) { return; } if (!DA.GetData("Run", ref run)) { return; } /// 0. create proto file /// 1.write header /// 2. retrieve meshes /// 3. ///define local parameters if (run == true) { ///0. Building building = new Building(); BuildingCollection building_collection = new BuildingCollection(); ///1. string[] header = { "@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns#>.", "@prefix rdfs: < http://www.w3.org/2000/01/rdf-schema#> .", "@prefix owl: < http://www.w3.org/2002/07/owl#> .", "@prefix dc: < http://purl.org/dc/elements/1.1/> .", "@prefix xsd: < http://www.w3.org/2001/XMLSchema#> .", "@prefix dcterms: < http://purl.org/dc/terms/> . ", "@prefix vann: < http://purl.org/vocab/vann/> .", "@prefix voaf: < http://purl.org/vocommons/voaf#> .", "@prefix foaf: < http://xmlns.com/foaf/0.1/>.", "@prefix bot: < https://w3id.org/bot#> .", "@prefix ifc: < http://www.buildingsmart-tech.org/ifcOWL/IFC4_ADD2#> .", "@prefix ifcowl: < https://w3id.org/bot/IFC4_ADD2Alignment#> .", "@prefix gr: http://purl.org/goodrelations/v1#.", "@prefix pto: < http://www.productontology.org/id/>." }; //const ObjectType filter = Rhino.DocObjects.ObjectType.Mesh; //Rhino.DocObjects.ObjRef[] objref; //var new_object_name = ""; ///// select all meshes in doc //Rhino.Input.RhinoGet.GetMultipleObjects("", true, filter, out objref); ////find layer /// find all meshes on that layer /// compute json information foreach (string cluster in Rhino_buildings) { var layer = Rhino.RhinoDoc.ActiveDoc.Layers.FindName(cluster); Rhino.DocObjects.RhinoObject[] rhobjs = RhinoDoc.ActiveDoc.Objects.FindByLayer(layer); List <RhinoObject> meshes = new List <RhinoObject>(); List <Guid> mesh_guids = new List <Guid>(); List <Point3d> mesh_centroids = new List <Point3d>(); List <Point3d> meshes_min = new List <Point3d>(); List <Point3d> meshes_max = new List <Point3d>(); foreach (RhinoObject mesh in rhobjs) { meshes.Add(mesh); mesh_guids.Add(mesh.Id); meshes_min.Add(mesh.Geometry.GetBoundingBox(false).Min); meshes_max.Add(mesh.Geometry.GetBoundingBox(false).Max); } building_collection.Buildings.Add(new Building() { GUID = layer.Id.ToString(), Inst = b, ProductquickfixBuilding = b, FogquickfixasObj = "", Rdfsquickfixlabel = b, objectCount = meshes.Count, building_max = meshes_max.Max().ToString(), building_min = meshes_min.Min().ToString(), BotquickfixBuilding = b, Rdfquickfixtype = "http://www.productontology.org/id/Building", botquickfixcontainsElement = mesh_guids.ToString(), };
IEnumerator Skip(IEnumerator action) { try { string name = nameField.GetValue(action) as string; BuildingInfo[] prefabs = prefabsField.GetValue(action) as BuildingInfo[]; string[] replaces = replacesField.GetValue(action) as string[]; if (replaces == null) { replaces = new string[0]; } List <BuildingInfo> keptPrefabs = null; List <string> keptReplaces = null; UsedAssets.Create(); for (int i = 0; i < prefabs.Length; i++) { BuildingInfo info = prefabs[i]; string replace = i < replaces.Length ? replaces[i] : null; if (Skip(info, replace)) { skippedPrefabs.Add(info.gameObject.name); if (keptPrefabs == null) { keptPrefabs = prefabs.ToList(i); if (i < replaces.Length) { keptReplaces = replaces.ToList(i); } } } else if (keptPrefabs != null) { keptPrefabs.Add(info); if (keptReplaces != null) { keptReplaces.Add(replace); } } } if (keptPrefabs != null) { BuildingInfo[] p = keptPrefabs.ToArray(); prefabsField.SetValue(action, p); prefabsField2.SetValue(action, p); BuildingCollection bc = GameObject.Find(name)?.GetComponent <BuildingCollection>(); // In the presence of the European Buildings Unlocker mod, bc is usually null. // Obviously caused by the Destroy() invokes in that mod. if (bc != null) { bc.m_prefabs = p; } if (keptReplaces != null) { string[] r = keptReplaces.ToArray(); replacesField.SetValue(action, r); replacesField2.SetValue(action, r); if (bc != null) { bc.m_replacedNames = r; } } if (p.Length == 0) { return(null); } } } catch (Exception e) { UnityEngine.Debug.LogException(e); } return(action); }