Exemplo n.º 1
0
 /// <summary>
 /// Fügt einen neuen Spieler hinzu.
 /// </summary>
 /// <param name="player">Der Player.</param>
 /// <returns>Der neue ActorHost zur Steuerung des Spielers.</returns>
 public ActorHost InsertPlayer(Player player)
 {
     var host = new ActorHost(player);
     actorHosts.Add(host);
     host.Initialize();
     return host;
 }
Exemplo n.º 2
0
        public ActorHost InjectPlayer(Player player)
        {
            var host = new ActorHost(player);

            updateDomains[0].ActorHosts.Add(host);
            return(host);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Fügt einen neuen Spieler hinzu.
        /// </summary>
        /// <param name="player">Der Player.</param>
        /// <returns>Der neue ActorHost zur Steuerung des Spielers.</returns>
        public ActorHost InsertPlayer(Player player)
        {
            var host = new ActorHost(player);

            actorHosts.Add(host);
            host.Initialize();
            return(host);
        }
        public override void Initialize()
        {
            World = new World();

            var p = Load();
            Player = World.InjectPlayer(p);
            Player.Initialize();

            base.Initialize();
        }
Exemplo n.º 5
0
        public void RemovePlayer(ActorHost host)
        {
            if (Simulation == null)
                throw new NotSupportedException();

            if (Simulation.State != SimulationState.Running && Simulation.State != SimulationState.Paused)
                throw new NotSupportedException();

            Simulation.RemovePlayer(host);
        }
Exemplo n.º 6
0
        public UpdateDomain(Stopwatch watch)
        {
            this.watch = watch;
            ActorHosts = new List<ActorHost>();
            var host = new ActorHost(new Player());
            ActorHosts.Add(host);

            Running = true;

            thread = new Thread(updateLoop);
            thread.IsBackground = true;
            thread.Priority = ThreadPriority.BelowNormal;
            thread.Start();
        }
Exemplo n.º 7
0
        public ActorHost InjectPlayer(Player player)
        {
            var cache  = ResourceManager.Instance.GetCacheForPlanet(player.Position.Planet);
            var loader = new ChunkLoader(cache, 14, player.Position.ChunkIndex);

            cache.EnsureLoaded(player.Position.ChunkIndex);
            cache.EnsureLoaded(player.Position.ChunkIndex + new Index3(0, 0, 1));
            cache.EnsureLoaded(player.Position.ChunkIndex + new Index3(0, 0, -1));

            var host = new ActorHost(player, loader);

            updateDomains[0].ActorHosts.Add(host);
            return(host);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Entfernt einen Spieler aus dem Spiel.
 /// </summary>
 /// <param name="host">Der ActorHost des Spielers.</param>
 public void RemovePlayer(ActorHost host)
 {
 }
Exemplo n.º 9
0
 /// <summary>
 /// Entfernt einen Spieler aus dem Spiel.
 /// </summary>
 /// <param name="host">Der ActorHost des Spielers.</param>
 public void RemovePlayer(ActorHost host)
 {
 }
Exemplo n.º 10
0
 public ActorHost InjectPlayer(Player player)
 {
     var host = new ActorHost(player);
     updateDomains[0].ActorHosts.Add(host);
     return host;
 }