예제 #1
0
    public Room(int _id, Server _server, ServerMessageHandler _sender, int _maxPlayers, RoomLogger logger)
    {
        maxPlayers = _maxPlayers;
        numPlayers = 0;
        sender     = _sender;
        server     = _server;
        started    = false;
        record     = "";
        id         = _id;

        activatedSwitchGroups = new List <int>();
        systemsManager        = new RoomSystems();
        obstacleManager       = new RoomObstacles();
        objectManager         = new RoomDestroyedObjects();
        poisHandler           = new PoisHandler();
        players         = new List <NetworkPlayer>();
        switchs         = new List <RoomSwitch>();
        enemies         = new List <NetworkEnemy>();
        deathGameObject = new List <string>();

        hpManager = new RoomHpMp(this);

        if (logger == null)
        {
            log = new RoomLogger(this.id);
        }
        else
        {
            log = logger;
        }
        sceneToLoad = Server.instance.sceneToLoad;
    }
예제 #2
0
    public void Reset()
    {
        systemsManager.Reset();
        obstacleManager.Reset();
        objectManager.Reset();
        poisHandler.Reset();

        activatedSwitchGroups = new List <int>();
        enemies       = new List <NetworkEnemy>();
        switchs       = new List <RoomSwitch>();
        hpManager     = new RoomHpMp(this);
        objectManager = new RoomDestroyedObjects();
        poisHandler   = new PoisHandler();
    }