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

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