private List <StorageContainer> GetTaxContainer(ulong Payor) { List <StorageContainer> Containers = new List <StorageContainer>(); foreach (var entry in ttData.TaxCollector.Where(kvp => kvp.Value.Contains(Payor))) { if (ttData.TaxBox.ContainsKey(entry.Key)) { Vector3 containerPos = new Vector3(ttData.TaxBox[entry.Key].x, ttData.TaxBox[entry.Key].y, ttData.TaxBox[entry.Key].z); foreach (StorageContainer Cont in StorageContainer.FindObjectsOfType <StorageContainer>()) { Vector3 ContPosition = Cont.transform.position; if (ContPosition == containerPos) { Containers.Add(Cont); } } } } if (Containers.Count > 0) { return(Containers); } else { return(null); } }
private List <StorageContainer> GetTaxContainer(ulong Payor) { if (isPayor(Payor) is bool) { return(null); } List <StorageContainer> Containers = new List <StorageContainer>(); foreach (var entry in (List <ushort>)isPayor(Payor)) { if (ftData.TaxBox.ContainsKey(entry)) { Vector3 containerPos = GetVector3(ftData.TaxBox[entry]); foreach (StorageContainer Cont in StorageContainer.FindObjectsOfType <StorageContainer>()) { Vector3 ContPosition = Cont.transform.position; if (ContPosition == containerPos) { Containers.Add(Cont); } } } } if (Containers.Count > 0) { return(Containers); } else { return(null); } }
void LoadTaxContainer() { foreach (StorageContainer Cont in StorageContainer.FindObjectsOfType <StorageContainer>()) { Vector3 ContPosition = Cont.transform.position; if (ContPosition.x == TaxChestX && ContPosition.y == TaxChestY && ContPosition.z == TaxChestZ) { Puts("Tax Container instance found: " + Cont.GetEntity().GetInstanceID()); TaxContainer = Cont; } } }