public MultyPlayerShootOut(MultyPlayerShootOut copy) : base() { targets = new List <Target>(copy.targets); TargetTypesAllowed = copy.TargetTypesAllowed; players = new Dictionary <string, Shooter>(copy.players); this.seed = copy.seed; this.TargetTypesAllowed = copy.TargetTypesAllowed; this.publisher = copy.publisher; //Target factory targetFactory = new TargetFactory(); targetFactory.actieTargets = this.targets; targetFactory.random = new Random(this.seed); targetFactory.TargetTypesAllowed = copy.TargetTypesAllowed; }
public override void start() { playersGame = new Dictionary <string, MultyPlayerShootOut>(); foreach (var shooter in players) { MultyPlayerShootOut game = new MultyPlayerShootOut(this.seed, TargetTypesAllowed); Dictionary <string, Shooter> localPlayers = new Dictionary <string, Shooter>(); localPlayers.Add(shooter.Key, shooter.Value); game.players = localPlayers; game.initPublisher(); game.fillTagets(); playersGame.Add(shooter.Key, game); } initPublisher(); publisher.NotifyGameStart(); timer.Start(); }