package entity;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import electrosphere.engine.Globals;
import electrosphere.engine.Main;
import electrosphere.engine.profiler.Profiler;
import electrosphere.logger.LoggerInterface;
import electrosphere.net.NetUtils;

public class SpawningCreaturesTest {

    @BeforeEach
    public void initEngine(){
        LoggerInterface.loggerEngine.INFO("[Test] Spawn many creatures");
        Globals.RUN_CLIENT = true;
        Globals.RUN_SERVER = true;
        Globals.HEADLESS = true;
        Profiler.PROFILE = false;
        NetUtils.setPort(0);
        Main.startUp();
    }
    
    // @Test
    // public void testSpawnCreature(){
    //     System.out.println("[Test] Spawn creature");
    //     Globals.RUN_CLIENT = false;
    //     Globals.RUN_SERVER = true;
    //     NetUtils.setPort(0);
    //     Main.startUp();
    //     CreatureUtils.spawnBasicCreature("human", null);
    //     Main.mainLoop(1);
    //     assert TestEntityUtils.numberOfEntitiesInBox(new Vector3d(-1,-1,-1),new Vector3d(1,1,1)) == 1;
    // }

    @Test
    public void testSpawnMultipleCreatures(){
        // Realm realm = Globals.realmManager.getRealms().iterator().next();
        // for(int i = 0; i < 100; i++){
        //     CreatureUtils.serverSpawnBasicCreature(realm, new Vector3d(0,0,0), "human", null);
        // }
        // Main.mainLoop(1);
        // assert TestEntityUtils.numberOfEntitiesInBox(new Vector3d(-1,-1,-1),new Vector3d(1,1,1)) == 100;
    }

}
