// Use this for initialization protected override void OnStart() { Warehouses.Add(this); left = new WarehouseRow(this, transform.GetChild(0).position); middle = new WarehouseRow(this, transform.GetChild(1).position); right = new WarehouseRow(this, transform.GetChild(2).position); }
public bool Release(ResourceComponent res, out WarehouseRow row) { ResourceRow <Warehouse> fromParent = null; bool released = _Release(res, out fromParent); row = fromParent as WarehouseRow; return(released); }
public void OnChildTriggerEnter(TriggerForwarder child, Collider other, IMovableSnappable res) { WarehouseRow whichRow = GetRow(child.name); if (whichRow != null && res is ResourceComponent && !CrateInterferenceTimers.ContainsKey(whichRow)) { whichRow.Capture(this, res as ResourceComponent); } }
public void DetachCrate(IMovableSnappable detaching) { WarehouseRow wasAttachedTo = null; //we don't know which row we are detaching from! so... //we have to search them all possibly //short circuit hack = if one of them returns true, the remaining calls will not be made if (this.left.Release(detaching as ResourceComponent, out wasAttachedTo) || this.middle.Release(detaching as ResourceComponent, out wasAttachedTo) || this.right.Release(detaching as ResourceComponent, out wasAttachedTo)) { this.CrateInterferenceTimers.Add(wasAttachedTo, StartCoroutine(CrateInterferenceCountdown(wasAttachedTo))); } }
public void RemoveWarehouseRow(WarehouseRow row) { this.Rows.Remove(row); }
public void AddWarehouseRow(WarehouseRow row) { this.Rows.Add(row); }
public WarehouseRowChangeEvent(WarehouseRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; }
private IEnumerator CrateInterferenceCountdown(WarehouseRow row) { yield return(new WaitForSeconds(SnapInterferenceTimerSeconds)); this.CrateInterferenceTimers.Remove(row); }