예제 #1
0
    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;
    }
예제 #2
0
    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();
    }