Beispiel #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;
 }
Beispiel #2
0
        public ActorHost InjectPlayer(Player player)
        {
            var host = new ActorHost(player);

            updateDomains[0].ActorHosts.Add(host);
            return(host);
        }
Beispiel #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();
        }
        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);
        }
Beispiel #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();
        }
Beispiel #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);
        }
Beispiel #8
0
 /// <summary>
 /// Entfernt einen Spieler aus dem Spiel.
 /// </summary>
 /// <param name="host">Der ActorHost des Spielers.</param>
 public void RemovePlayer(ActorHost host)
 {
 }
Beispiel #9
0
 /// <summary>
 /// Entfernt einen Spieler aus dem Spiel.
 /// </summary>
 /// <param name="host">Der ActorHost des Spielers.</param>
 public void RemovePlayer(ActorHost host)
 {
 }
Beispiel #10
0
 public ActorHost InjectPlayer(Player player)
 {
     var host = new ActorHost(player);
     updateDomains[0].ActorHosts.Add(host);
     return host;
 }