java.lang.Object
technology.sola.ecs.cache.ViewCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ViewNcreateView(Class<? extends Component>... componentClasses) Gets aViewNfor the desired component classes from the cache or creates it if it does not exist.createView(Class<C1> c1Class) Gets aView1for the desired component class from the cache or creates it if it does not exist.createView(Class<C1> c1Class, Class<C2> c2Class) Gets aView2for the desired component classes from the cache or creates it if it does not exist.createView(Class<C1> c1Class, Class<C2> c2Class, Class<C3> c3Class) Gets aView3for the desired component classes from the cache or creates it if it does not exist.<C1 extends Component,C2 extends Component, C3 extends Component, C4 extends Component>
View4<C1,C2, C3, C4> createView(Class<C1> c1Class, Class<C2> c2Class, Class<C3> c3Class, Class<C4> c4Class) Gets aView4for the desired component classes from the cache or creates it if it does not exist.voiddestroyView(Class<? extends Component>[] componentClasses) Destroys a view from the cache so that it no longer will receive any updates.voidupdateForAddComponent(Entity entity, Class<? extends Component> componentClass) voidupdateForDeletedEntity(Entity entity) voidupdateForDisabledStateChange(Entity entity) voidupdateForRemoveComponent(Entity entity, Class<? extends Component> componentClass)
-
Constructor Details
-
ViewCache
Creates a ViewCache instance for aWorld- Parameters:
world- theWorldinstance
-
-
Method Details
-
createView
Gets aView1for the desired component class from the cache or creates it if it does not exist.- Type Parameters:
C1- the component type- Parameters:
c1Class- theComponentclass- Returns:
- the
View1
-
createView
public <C1 extends Component,C2 extends Component> View2<C1,C2> createView(Class<C1> c1Class, Class<C2> c2Class) Gets aView2for the desired component classes from the cache or creates it if it does not exist.- Type Parameters:
C1- the first component typeC2- the second component type- Parameters:
c1Class- the firstComponentclassc2Class- the secondComponentclass- Returns:
- the
View2
-
createView
public <C1 extends Component,C2 extends Component, View3<C1,C3 extends Component> C2, createViewC3> (Class<C1> c1Class, Class<C2> c2Class, Class<C3> c3Class) Gets aView3for the desired component classes from the cache or creates it if it does not exist.- Type Parameters:
C1- the first component typeC2- the second component typeC3- the third component type- Parameters:
c1Class- the firstComponentclassc2Class- the secondComponentclassc3Class- the thirdComponentclass- Returns:
- the
View3
-
createView
public <C1 extends Component,C2 extends Component, View4<C1,C3 extends Component, C4 extends Component> C2, createViewC3, C4> (Class<C1> c1Class, Class<C2> c2Class, Class<C3> c3Class, Class<C4> c4Class) Gets aView4for the desired component classes from the cache or creates it if it does not exist.- Type Parameters:
C1- the first component typeC2- the second component typeC3- the third component typeC4- the fourth component type- Parameters:
c1Class- the firstComponentclassc2Class- the secondComponentclassc3Class- the thirdComponentclassc4Class- the fourthComponentclass- Returns:
- the
View4
-
createView
Gets aViewNfor the desired component classes from the cache or creates it if it does not exist.- Parameters:
componentClasses- the component classes for the view- Returns:
- the
ViewN
-
destroyView
Destroys a view from the cache so that it no longer will receive any updates.- Parameters:
componentClasses- the component classes for the view
-
updateForAddComponent
- Parameters:
entity- theEntityupdatedcomponentClass- the class of theComponentadded to the entity
-
updateForRemoveComponent
- Parameters:
entity- theEntityupdatedcomponentClass- the class of theComponentremoved from the entity
-
updateForDisabledStateChange
- Parameters:
entity- theEntityupdate
-
updateForDeletedEntity
- Parameters:
entity- theEntitydeleted
-