private static Color32 getDepositColor(ResourceDefinition definition, IBodyResources bodyResources, ICellResource deposit) { Color32 color; if (deposit != null) { var ratio = (float)(deposit.Quantity / bodyResources.MaxQuantity); color = (Color32)(definition.ColorFull * ratio + definition.ColorEmpty * (1 - ratio)); } else { color = colorEmpty; } return(color); }
private static Color32 getDepositColor(ResourceDefinition definition, IBodyResources bodyResources, ICellResource deposit) { Color32 color; if (deposit != null) { var ratio = (float)(deposit.Quantity / bodyResources.MaxQuantity); color = (Color32)(definition.ColorFull * ratio + definition.ColorEmpty * (1 - ratio)); } else { color = colorEmpty; } return color; }
protected BodyResourceData(IBodyResources resources, CellSet scans) { Resources = resources; this.scans = scans; }