public Connection(ContainerAttachmentPoint second, double throughput) { Construct(); _throughput = throughput; _secondContainer = second; }
void Construct() { tags.Add("connection"); _throughput = 0; _secondContainer = null; }
public Connection() : base() { Construct(); _throughput = 0; _secondContainer = null; }
public void AddConnection(ContainerAttachmentPoint second, double throughput = 0, bool isTwoWay = true) { connections.Add(new Connection(second, throughput)); if (isTwoWay && second != null) { second.AddConnection(new Connection(this, throughput)); } }
private void Act() { List <Verb> traversalVerbs = GetVerbs("TraversalVerb"); if (traversalVerbs.Count > 0) { ContainerAttachmentPoint container = controlledObject.container as ContainerAttachmentPoint; if (container != null) { Connection[] connections = container.GetConnections(); int choice = random.Next(0, connections.Length); Dictionary <string, object> data = new Dictionary <string, object>(); data["target"] = connections[choice]; traversalVerbs[0].Register(data); // XXX: Should pick most appropriate traversal verb } } }
public void Unload() { InputManager.instance.inputReceived -= player.ParseInput; player = null; // For now delete everything non root foreach (GameObject root in rootObjects) { Container containerRoot = root as Container; if (containerRoot != null) { ContainerAttachmentPoint contents = containerRoot.GetContents(); foreach (GameObject obj in contents.GetAttached()) { contents.Remove(obj); } } } }
public Connection(Dictionary <string, object> data) : base(data) { Construct(); if (data.ContainsKey("second")) { _secondContainer = data["second"] as ContainerAttachmentPoint; } if (data.ContainsKey("throughput")) { _throughput = (double)data["throughput"]; } if (!data.ContainsKey("description")) { description = "an opening"; } }
public void AddConnection(Dictionary <string, object> data, bool isTwoWay = true) { if (!data.ContainsKey("parent")) { data.Add("parent", this); } else { data["parent"] = this; } connections.Add(new Connection(data)); if (isTwoWay && data.ContainsKey("second")) { ContainerAttachmentPoint second = data["second"] as ContainerAttachmentPoint; data["parent"] = second; data["second"] = this; second.AddConnection(new Connection(data)); } }
private void Construct() { tags.Add("container"); contents = new ContainerAttachmentPoint(new Dictionary <string, object>() { { "parent", this }, { "capacity", 0.0 }, { "name", "contents" } }); AddAttachmentPoint(contents); spawnLists = new List <SpawnList>(); objectData["innervolume"] = GetDescriptiveInnerVolume; objectData["filledvolume"] = GetDescriptiveFilledVolume; objectData["remainingvolume"] = GetDescriptiveRemainingVolume; objectData["volumeratio"] = GetDescriptionVolumeRatio; relevantData.Insert(0, GetDescriptionVolumeRatio); relevantData.Add(GetDescriptiveRemainingVolume); relevantData.Add(GetDescriptiveInnerVolume); relevantData.Add(GetDescriptiveFilledVolume); }
public void AddConnection(ContainerAttachmentPoint second, double throughput = 0, bool isTwoWay = true) { contents.AddConnection(second, throughput, isTwoWay); }