5 protected bool m_bHasDetectedContainers;
6 protected float m_fMaxStoredResourceValue;
9 float GetMaxStoredResourceValue()
11 if (m_bHasDetectedContainers)
12 return Math.Min(m_fMaxStoredResourceValue, m_ContainerFrom.GetResourceValue());
18 protected bool IsSourceValid(notnull IEntity entity)
20 if (entity == m_ContainerFrom.GetOwner())
23 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(entity.FindComponent(SCR_ResourceComponent));
30 if (!m_ContainerToCached)
33 if (!m_bHasDetectedContainers && m_ContainerToCached.IsAllowedToStoreResource())
34 m_bHasDetectedContainers =
true;
36 return m_ContainerToCached.CanStoreResource();
40 protected bool ProcessStorage(notnull IEntity entity)
42 m_bHasDetectedContainers =
true;
43 m_fMaxStoredResourceValue += m_ContainerToCached.ComputeResourceDifference();
45 return m_fMaxStoredResourceValue < m_ContainerFrom.GetResourceValue();
51 m_ContainerFrom = container;