Skip to content

Commit c5ea36c

Browse files
author
Valentin Vetter
committed
feat(viewport): restrict Viewports to Groups
1 parent b04d7b8 commit c5ea36c

File tree

1 file changed

+5
-3
lines changed
  • engine/modules/viewport/src/main/java/com/codingame/gameengine/module/viewport

1 file changed

+5
-3
lines changed

engine/modules/viewport/src/main/java/com/codingame/gameengine/module/viewport/ViewportModule.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.codingame.gameengine.core.GameManager;
88
import com.codingame.gameengine.core.Module;
99
import com.codingame.gameengine.module.entities.GraphicEntityModule;
10+
import com.codingame.gameengine.module.entities.Group;
1011
import com.google.inject.Inject;
1112
import com.google.inject.Singleton;
1213

@@ -53,11 +54,12 @@ private void sendFrameData() {
5354
}
5455

5556
/**
56-
* Makes the Entity with the given ID a Viewport
57+
* Makes the given Group a Viewport.
5758
*
58-
* @param entityId
59+
* @param group
5960
*/
60-
public void createViewport(int entityId) {
61+
public void createViewport(Group group) {
62+
int entityId = group.getId();
6163
if (!registered.contains(entityId)) {
6264
newEntityIds.add(entityId);
6365
registered.add(entityId);

0 commit comments

Comments
 (0)