Exemplo n.º 1
0
 public DisplayController(IBallot ballot, ISeatService seatService, IMember member, ICouncilSession session, IVote vote)
 {
     _ballot      = ballot;
     _member      = member;
     _session     = session;
     _vote        = vote;
     _seatService = seatService;
 }
Exemplo n.º 2
0
        public void ClaimTheThrone(IBallot ballot)
        {
            Dictionary <IKingdom, HashSet <IKingdom> > winners = ballot.GetWinners();

            KeyValuePair <IKingdom, HashSet <IKingdom> > winner = winners.FirstOrDefault();

            if (winners.Count > 0 && winner.Value.Count >= MINIMUMALLIESTOCLAIMTHETHRONE)
            {
                this.Ruler = winner.Key;
                foreach (IKingdom ally in winner.Value)
                {
                    this.Ruler.AddAlly(ally);
                }
            }
        }
Exemplo n.º 3
0
        public HomeController(ILogger <HomeController> logger, IMemberRegister memberRegister, ICouncilSession session, IBallot ballot, IMember member, IVote vote, ISeatService seatService, IConfiguration configuration)
        {
            _configuration  = configuration;
            _memberRegister = memberRegister;
            _session        = session;
            _ballot         = ballot;
            _member         = member;
            _vote           = vote;
            _logger         = logger;
            _seatService    = seatService;

            model = new HomeIndexViewModel
            {
                Session = _session.GetActiveSession(),
                Ballot  = _ballot.GetActiveOrLast()
            };
        }
Exemplo n.º 4
0
        public AdminController(ILogger <AdminController> logger, ICouncilSession session, IBallot ballot,
                               IMember member, IMemberRegister memberRegister, IConfiguration configuration,
                               IHostingEnvironment hostingEnvironment, ISeatService seatService)
        {
            _logger  = logger;
            _session = session;
            _ballot  = ballot;
            _member  = member;

            _memberRegister = memberRegister;
            _seatService    = seatService;

            _configuration = configuration;
            _env           = hostingEnvironment;

            model = new AdminIndexViewModel
            {
                ActiveOrLastBallot = _ballot.GetActiveOrLast(),
                Members            = _member.GetAllMembers(true),
                CouncilSession     = _session.GetActiveSession(),
                Register           = _memberRegister.GetStatusAllMember(),
                BallotsThisSession = _ballot.GetBallotsThisSession(_session.GetActiveSession())
            };
        }