Package org.terasology.engine

Examples of org.terasology.engine.EngineTime


        this.joinStatus = joinStatus;
    }

    @Override
    public void init(GameEngine engine) {
        EngineTime time = (EngineTime) CoreRegistry.get(Time.class);
        time.setPaused(true);
        time.setGameTime(0);
       
        CoreRegistry.get(Game.class).load(gameManifest);
        switch (netMode) {
            case CLIENT:
                initClient();
View Full Code Here


        }
    }

    @Override
    public void dispose() {
        EngineTime time = (EngineTime) CoreRegistry.get(Time.class);
        time.setPaused(false);
    }
View Full Code Here

    }

    @Override
    public void update(float delta) {
        GameEngine gameEngine = CoreRegistry.get(GameEngine.class);
        EngineTime time = (EngineTime) CoreRegistry.get(Time.class);
        long startTime = time.getRawTimeInMs();
        while (current != null && time.getRawTimeInMs() - startTime < 20 && !gameEngine.hasPendingState()) {
            if (current.step()) {
                popStep();
            }
        }
        if (current == null) {
View Full Code Here

    }

    @Before
    public void setup() throws Exception {
        super.setup();
        EngineTime mockTime = mock(EngineTime.class);
        networkSystem = new NetworkSystemImpl(mockTime);

        entityManager = new EntitySystemBuilder().build(CoreRegistry.get(ModuleManager.class).getEnvironment(), networkSystem, new ReflectionReflectFactory());
        CoreRegistry.put(ComponentSystemManager.class, new ComponentSystemManager());
        entityManager.clear();
View Full Code Here

    }

    @Test
    public void testNetwork() throws Exception {
        EngineEntityManager entityManager = getEntityManager();
        EngineTime time = mock(EngineTime.class);
        NetworkSystem server = new NetworkSystemImpl(time);
        netSystems.add(server);
        server.connectToEntitySystem(entityManager, CoreRegistry.get(EntitySystemLibrary.class), null);
        server.host(7777, true);
View Full Code Here

    public void entityNetworkIdChangedOnServerStart() throws HostingFailedException {
        EngineEntityManager entityManager = getEntityManager();
        NetworkComponent netComp = new NetworkComponent();
        netComp.setNetworkId(122);
        EntityRef entity = entityManager.create(netComp);
        EngineTime time = mock(EngineTime.class);
        NetworkSystem server = new NetworkSystemImpl(time);
        netSystems.add(server);
        server.connectToEntitySystem(entityManager, CoreRegistry.get(EntitySystemLibrary.class), null);
        server.host(7777, true);
View Full Code Here

        CoreRegistry.put(StorageManager.class, new StorageManagerInternal(moduleManager.getEnvironment(), engineEntityManager));
    }

    @Override
    protected void setupNetwork() {
        EngineTime mockTime = mock(EngineTime.class);
        CoreRegistry.put(Time.class, mockTime);
        NetworkSystem networkSystem = new NetworkSystemImpl(mockTime);
        CoreRegistry.put(NetworkSystem.class, networkSystem);
    }
View Full Code Here

    @Override
    public void dispose() {
    }

    private void initTimer() {
        EngineTime time = new TimeSystem();
        CoreRegistry.putPermanently(Time.class, time);
    }
View Full Code Here

    @Override
    public void dispose() {
    }

    private void initTimer() {
        EngineTime time = new TimeLwjgl();
        CoreRegistry.putPermanently(Time.class, time);
    }
View Full Code Here

    @Override
    public boolean step() {
        if (worldRenderer.pregenerateChunks()) {
            return true;
        }
        EngineTime time = (EngineTime) CoreRegistry.get(Time.class);
        long totalTime = time.getRawTimeInMs() - startTime;
        return totalTime > 5000;
    }
View Full Code Here

TOP

Related Classes of org.terasology.engine.EngineTime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.