public bool RemoveAdjuster(string resourceId, ResourceAdjuster adjuster) { Resource resource = resources.Get(resourceId); if (resource == null) { return(false); } return(resource.RemoveAdjuster(adjuster)); }
public bool AddAdjuster(string resourceId, ResourceAdjuster adjuster) { Resource resource = resources.Get(resourceId); if (resource == null) { return(false); } resource.AddAdjuster(adjuster); return(true); }
private void CreateResourceAdjuster(Resource resource) { if (resourceAdjusterPrefab == null) { Debug.LogWarning("ResourcesAdjusterPrefab is null"); return; } ResourceAdjuster resourceAdjuster = Instantiate(resourceAdjusterPrefab, adjustersContainer); if (resource.ResourceType == ResourcesDSID.Fuel) { resourceAdjuster.SetUpAdjuster(resource, 30, this); } else { resourceAdjuster.SetUpAdjuster(resource, true, DSModelManager.Instance.ShipsModel.GetMaxNoFuel(dock.Ship.shipType), this); } resourceAdjuster.onResourceChange += ResourceAdjuster_OnResourceChange; resourceAdjusters.Add(resourceAdjuster); }
public bool RemoveAdjuster(string resourceId, ResourceAdjuster adjuster) { Resource resource = resources.Get(resourceId); if (resource == null) return false; return resource.RemoveAdjuster(adjuster); }
public bool AddAdjuster(string resourceId, ResourceAdjuster adjuster) { Resource resource = resources.Get(resourceId); if (resource == null) return false; resource.AddAdjuster(adjuster); return true; }
public bool RemoveAdjuster(ResourceAdjuster adjuster) { return adjusters.Remove(adjuster); }
public bool HasAdjuster(ResourceAdjuster adjuster) { return adjusters.Contains(adjuster); }
public void AddAdjuster(ResourceAdjuster adjuster) { adjusters.Add(adjuster); }
public bool RemoveAdjuster(ResourceAdjuster adjuster) { return(adjusters.Remove(adjuster)); }
public bool HasAdjuster(ResourceAdjuster adjuster) { return(adjusters.Contains(adjuster)); }