Interface IModuleContainerView

All Known Subinterfaces:
IBuildingView, IBuildingWorkerView, ITownHallView
All Known Implementing Classes:
AbstractBuildingBuilderView, AbstractBuildingGuards.View, AbstractBuildingView, BuildingBarracks.View, BuildingBeekeeper.View, BuildingBuilder.View, BuildingCook.View, BuildingGateHouse.View, BuildingGuardTower.View, BuildingLumberjack.View, BuildingMysticalSite.View, BuildingTownHall.View, BuildingWareHouse.View, EmptyView, HomeBuildingModule.View, LivingBuildingView, PostBox.View, TavernBuildingModule.View

public interface IModuleContainerView
  • Method Details

    • getModuleViewByType

      <T extends IBuildingModuleView> T getModuleViewByType(Class<T> clazz)
      Get the first module view matching the class.
      Type Parameters:
      T - the type of module returned.
      Parameters:
      clazz - the class to match.
      Returns:
      the module.
    • getModuleView

      IBuildingModuleView getModuleView(int id)
      Get the first module with a particular class or interface.
      Returns:
      the module or empty if not existent.
    • getModuleView

      <M extends IBuildingModule, V extends IBuildingModuleView> V getModuleView(BuildingEntry.ModuleProducer<M,V> producer)
      Get the first module with a particular class or interface.
      Returns:
      the module or empty if not existent.
    • hasModuleView

      boolean hasModuleView(BuildingEntry.ModuleProducer producer)
      Check if the object has a particular module.
      Parameters:
      producer - the module producer for the module
      Returns:
      true if so.
    • getModuleViewMatching

      @Nullable <T extends IBuildingModuleView> T getModuleViewMatching(Class<T> clazz, Predicate<? super T> modulePredicate)
      Get the module view matching a certain predicate.
      Type Parameters:
      T - the optional type.
      Parameters:
      clazz - the class of the module.
      modulePredicate - the predicate to match.
      Returns:
      the module.
    • getModuleViews

      <T extends IBuildingModuleView> List<T> getModuleViews(Class<T> clazz)
      Get a list of all modules matching a specific class.
      Type Parameters:
      T - the type of module.
      Parameters:
      clazz - the class to match.
      Returns:
      the list or empty if doesn't exist.
    • registerModule

      void registerModule(IBuildingModuleView iModuleView)
      Register a view module with the building.
      Parameters:
      iModuleView - the view.
    • getAllModuleViews

      List<IBuildingModuleView> getAllModuleViews()
      Get all module views in a list.
      Returns:
      the list of views.