Newer
Older
AlgebraicDataflowArchitectureModel / GameEngine / src / main / java / gameEngine / entites / GameObject.java
NoranekoFelician on 7 Oct 868 bytes Editor用Windowを仮で作成
package gameEngine.entites;

import gameEngine.entites.gameComponents.GameComponent;

import java.util.ArrayList;
import java.util.List;

public class GameObject extends Entity {
    public boolean active = true;
    public String name = "GameObject";
    private final List<GameComponent> gameComponents = new ArrayList<>();

    public void addComponent(GameComponent component) {
        this.gameComponents.add(component);
    }

    public void initComponents() {
        for (GameComponent component : gameComponents) {
            component.init();
        }
    }

    public void updateComponents() {
        for (GameComponent component : gameComponents) {
            component.update();
        }
    }

    public void setName(String name){
        this.name = name;
    }

    public void setActive(boolean active) {
        this.active = active;
    }
}