public Container(InRange inRange, ContainerModule containerModule, ContainerUsefulness usefulness)
            {
                _inRange = inRange;

                Module     = containerModule;
                Usefulness = usefulness;
            }
        private Boolean TryMakeContainerSilhouette(ContainerUsefulness reason, out SilhouetteType silhouette)
        {
            switch (reason)
            {
            case ContainerUsefulness.NoWay:
                silhouette = SilhouetteType.Transparent;
                return(false);

            case ContainerUsefulness.Useful:
                silhouette = SilhouetteColors.Instance.Items;
                break;

            case ContainerUsefulness.Empty:
                silhouette = SilhouetteColors.Instance.NotInterested;
                break;

            case ContainerUsefulness.Locked:
                silhouette = SilhouetteColors.Instance.Locked;
                break;

            case ContainerUsefulness.Restricted:
                silhouette = SilhouetteColors.Instance.Restricted;
                break;

            default:
                throw new NotSupportedException(reason.ToString());
            }

            return(true);
        }
        private void HighlightContainer(ContainerModule container)
        {
            ContainerUsefulness usefulness = UsefulContainerEntityFilter.Check(container);

            if (TryMakeContainerSilhouette(usefulness, out var silhouette))
            {
                _hoverData.AddCommand(new SilhouetteCommand(container.Entity.Actor.gameObject, silhouette));
            }
        }
 public IEnumerable <Container> EnumerateContainers()
 {
     foreach (var entity in Entities)
     {
         ContainerModule container = entity.Entity.GetModule <ContainerModule>();
         if (container)
         {
             ContainerUsefulness usefulness = UsefulContainerEntityFilter.Check(container);
             yield return(new Container(entity, container, usefulness));
         }
     }
 }