Exemplo n.º 1
0
        void AddEntities()
        {
            //Factory
            AddChild(new FactoryEntity(this));

            //Config
            ConfigEntity config = new ConfigEntity(this);

            AddChild(config);

            //Collision
            CollisionEntity collision = new CollisionEntity(this);

            AddChild(collision);

            //Pathfinding
            PathfindingEntity pathfinding = new PathfindingEntity(this);

            AddChild(pathfinding);

            //VisionManager
            VisionManagerEntity visionManager = new VisionManagerEntity(collision, config.GetFloat("VisionRadius"), this);

            AddChild(visionManager);

            //UnitManager
            UnitManagerEntity unitManager = new UnitManagerEntity(this);

            AddChild(unitManager);

            //ClientManager
            ClientManagerEntity clientManager = new ClientManagerEntity(this);

            clientManager.SetEntities(unitManager, collision, visionManager);
            AddChild(clientManager);

            //Network
            AddChild(new NetworkEntity(clientManager, (ushort)config.GetInt("Port"), this));
        }
Exemplo n.º 2
0
 public void SetEntities(UnitManagerEntity unitManager, CollisionEntity collision, VisionManagerEntity visionManager)
 {
     this.unitManager   = unitManager;
     this.collision     = collision;
     this.visionManager = visionManager;
 }