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