Esempio n. 1
0
        public GameSetup(string owner, string repo, string token, IEnumerable<Octokit.GitHubCommit> commits)
        {
            this.hash = HashHelper.GetMD5($"{owner}/{repo}");

            this.owner = owner;
            this.repository = repo;
            this.token = token;

            this.commits = commits.ToArray();
            this.settings = GameSettings.None;
            this.count = commits.Count(filter);

            this.messages = new List<Message>();
            this.messages.Add(StateMessage.CreateSetup());

            this.contributors = new List<Models.Contributor>();
            this.users = new List<User>();

            Models.GameSettings settings = new Models.GameSettings();

            settings.ExcludeMerges = false;
            settings.LowerCase = false;
            settings.Contributors = GetContributors().Select(x => new Models.GameSettings.Contributor() { Name = x.Name, Active = x.Active }).ToArray();

            this.SetSettings(settings);
        }
Esempio n. 2
0
        public static SetupMessage FromStream(DateTime timestamp, Stream stream)
        {
            bool? ex = stream.ReadNullBoolean();
            bool? low = stream.ReadNullBoolean();

            int count = stream.ReadInt32();
            var contributors = new Models.GameSettings.Contributor[count];
            for (int i = 0; i < count; i++)
            {
                var name = stream.ReadString();
                var active = stream.ReadBoolean();
                contributors[i] = new Models.GameSettings.Contributor() { Name = name, Active = active };
            }

            var settings = new Models.GameSettings()
            {
                ExcludeMerges = ex,
                LowerCase = low,
                Contributors = contributors
            };

            return new SetupMessage(timestamp, settings);
        }
Esempio n. 3
0
 public SetupMessage(Models.GameSettings settings)
 {
     this.settings = settings;
 }
Esempio n. 4
0
 private SetupMessage(DateTime timestamp, Models.GameSettings settings)
     : base(timestamp)
 {
     this.settings = settings;
 }