예제 #1
0
        public StackEggGame Initialize()
        {
            DaysElapsed    = 0;
            CurrentPhaseId = ReachedActivePhaseId = StackEggPhase.Id.PrivateBeta;

            Stats = new Dictionary <StackEggStat, double>()
            {
                { StackEggStat.Questions, 0.0 },
                { StackEggStat.Answers, 0.0 },
                { StackEggStat.Quality, 0.0 },
                { StackEggStat.Users, 0.0 },
                { StackEggStat.Traffic, 0.0 }
            };

            AccumulatedStats = new Dictionary <StackEggStat, int>()
            {
                { StackEggStat.Questions, 0 },
                { StackEggStat.Answers, 0 },
                { StackEggStat.Quality, 0 },
                { StackEggStat.Users, 0 },
                { StackEggStat.Traffic, 0 }
            };

            ModeratorFlags = 0;
            //AdvanceToNextPhase(); AdvanceToNextPhase();

            return(this);
        }
예제 #2
0
        private void AdvanceToNextPhase()
        {
            var oldPhase = CurrentPhase;

            CurrentPhaseId = oldPhase.NextPhaseId;

            if (CurrentPhase != null)
            {
                ModeratorFlags++;
                ReachedActivePhaseId = CurrentPhaseId;

                // stats that were available in the old phase are set to 1, the others stay at 0
                // (note we're relying on the fact that AvailableStats only gets new stats, but never
                // has stats removed)
                foreach (var oldStat in oldPhase.AvailableStats)
                {
                    Stats[oldStat]            = 1.0;
                    AccumulatedStats[oldStat] = 0;
                }
            }
        }