java.lang.Object
technology.sola.ecs.cache.ViewCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ViewN
createView
(Class<? extends Component>... componentClasses) Gets aViewN
for the desired component classes from the cache or creates it if it does not exist.createView
(Class<C1> c1Class) Gets aView1
for the desired component class from the cache or creates it if it does not exist.createView
(Class<C1> c1Class, Class<C2> c2Class) Gets aView2
for 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 aView3
for 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 aView4
for the desired component classes from the cache or creates it if it does not exist.void
destroyView
(Class<? extends Component>[] componentClasses) Destroys a view from the cache so that it no longer will receive any updates.void
updateForAddComponent
(Entity entity, Class<? extends Component> componentClass) void
updateForDeletedEntity
(Entity entity) void
updateForDisabledStateChange
(Entity entity) void
updateForRemoveComponent
(Entity entity, Class<? extends Component> componentClass)
-
Constructor Details
-
ViewCache
Creates a ViewCache instance for aWorld
- Parameters:
world
- theWorld
instance
-
-
Method Details
-
createView
Gets aView1
for the desired component class from the cache or creates it if it does not exist.- Type Parameters:
C1
- the component type- Parameters:
c1Class
- theComponent
class- Returns:
- the
View1
-
createView
public <C1 extends Component,C2 extends Component> View2<C1,C2> createView(Class<C1> c1Class, Class<C2> c2Class) Gets aView2
for 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 firstComponent
classc2Class
- the secondComponent
class- 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 aView3
for 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 firstComponent
classc2Class
- the secondComponent
classc3Class
- the thirdComponent
class- 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 aView4
for 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 firstComponent
classc2Class
- the secondComponent
classc3Class
- the thirdComponent
classc4Class
- the fourthComponent
class- Returns:
- the
View4
-
createView
Gets aViewN
for 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
- theEntity
updatedcomponentClass
- the class of theComponent
added to the entity
-
updateForRemoveComponent
- Parameters:
entity
- theEntity
updatedcomponentClass
- the class of theComponent
removed from the entity
-
updateForDisabledStateChange
- Parameters:
entity
- theEntity
update
-
updateForDeletedEntity
- Parameters:
entity
- theEntity
deleted
-