// * WPP: if possible, store RenderTextures in KnowledgeMapData fields RenderTexture GetRenderTexture(KnowledgeMapId id) { switch (id) { case KnowledgeMapId.Decomposers: return(simulationManager.vegetationManager.resourceGridRT1); case KnowledgeMapId.Algae: return(simulationManager.vegetationManager.resourceGridRT1); case KnowledgeMapId.Plants: return(fluidManager._SourceColorRT); case KnowledgeMapId.Microbes: return(fluidManager._SourceColorRT); case KnowledgeMapId.Animals: return(fluidManager._SourceColorRT); case KnowledgeMapId.World: return(theRenderKing.baronVonTerrain.terrainHeightDataRT); case KnowledgeMapId.Stone: return(theRenderKing.baronVonTerrain.terrainHeightDataRT); case KnowledgeMapId.Pebbles: return(theRenderKing.baronVonTerrain.terrainHeightDataRT); case KnowledgeMapId.Sand: return(theRenderKing.baronVonTerrain.terrainHeightDataRT); case KnowledgeMapId.Nutrients: return(simulationManager.vegetationManager.resourceGridRT1); case KnowledgeMapId.Water: return(theRenderKing.baronVonWater.waterSurfaceDataRT0); case KnowledgeMapId.Wind: return(theRenderKing.baronVonWater.waterSurfaceDataRT0); case KnowledgeMapId.Detritus: return(simulationManager.vegetationManager.resourceGridRT1); default: return(null); } }
// TBD: cache specific elements for faster lookup public TrophicLayerSO GetTrophicSlotData(KnowledgeMapId id) { foreach (var map in knowledgeMaps) { if (map.id == id) { return(map); } } Debug.LogError("Invalid map state " + id); return(knowledgeMaps[0]); }
public TrophicSlot GetSlot(KnowledgeMapId id) { foreach (var slot in allTrophicSlots) { if (slot.data.id == id) { return(slot); } } Debug.LogError("Invalid slot " + id); return(null); }
int TimeStepLayerOn(KnowledgeMapId layer) { switch (layer) { case KnowledgeMapId.Microbes: return(timeStepZooplanktonOn); case KnowledgeMapId.Plants: return(timeStepPlantsOn); case KnowledgeMapId.Algae: return(timeStepAlgaeOn); case KnowledgeMapId.Decomposers: return(timeStepDecomposersOn); default: return(0); } }
public bool IsLayerOn(KnowledgeMapId layer) { switch (layer) { case KnowledgeMapId.Decomposers: return(decomposersOn); case KnowledgeMapId.Algae: return(algaeOn); case KnowledgeMapId.Plants: return(plantsOn); case KnowledgeMapId.Microbes: return(zooplanktonOn); case KnowledgeMapId.Animals: return(agentsOn); default: return(false); } }
public void SetFollowing(KnowledgeMapId id) { isFollowingAgent = id == KnowledgeMapId.Animals; isFollowingPlantParticle = id == KnowledgeMapId.Plants; isFollowingAnimalParticle = id == KnowledgeMapId.Microbes; }
public void SetSlot(KnowledgeMapId id) { SetSlot(lookup.GetTrophicSlotData(id)); }
public float GetLayerLerp(KnowledgeMapId layer, int timeStep) { return(IsLayerOn(layer) ? Mathf.Clamp01((float)(timeStep - TimeStepLayerOn(layer)) / (float)timeStepsLayerGrowthDuration) : 0f); }
public void SetSlotStatus(KnowledgeMapId id, TrophicSlotStatus value) { GetSlot(id).status = value; }