示例#1
0
 public static CounterState OnSetCounter(CounterState state, SetCount action)
 {
     return(state with
     {
         Count = action.Count
     });
 }
示例#2
0
 private void SetCount_Click(object sender, EventArgs e)
 {
     Nb_regions.Minimum = Nb_regions.Maximum = Nb_regions.Value;
     Nb_Corp.Minimum    = Nb_Corp.Maximum = Nb_Corp.Value;
     Nb_Trans.Minimum   = Nb_Trans.Maximum = Nb_Trans.Value;
     SetCount.Hide();
     regPanel.Show();
     sendbuf = Nb_regions.Value.ToString() + 13;
 }
示例#3
0
        private SetCount GetSetCount()
        {
            var sc = new SetCount();

            foreach (var t in Tasks)
            {
                t.GetSetCount(sc);
            }
            return(sc);
        }
示例#4
0
        public override int GetHashCode()
        {
            int hashCode = 2062186786;

            hashCode = (hashCode * -1521134295) + EqualityComparer <ITeamInMatch> .Default.GetHashCode(Team);

            hashCode = (hashCode * -1521134295) + SetCount.GetHashCode();
            hashCode = (hashCode * -1521134295) + GameCount.GetHashCode();
            hashCode = (hashCode * -1521134295) + Points.GetHashCode();
            return(hashCode);
        }
示例#5
0
 public void GetSetCount(SetCount sc)
 {
     if (_Start == UNSET)
     {
         sc.Unset++;
     }
     else
     {
         sc.Set++;
     }
     foreach (var t in Tasks)
     {
         t.GetSetCount(sc);
     }
 }
示例#6
0
        public void CalculateTimes()
        {
            var priorSC = new SetCount();
            var sc      = GetSetCount();

            while (sc.Unset != priorSC.Unset)
            {
                priorSC = sc;

                foreach (var t in Tasks)
                {
                    t.CalculateTime(Start);
                }

                sc = GetSetCount();
            }
            if (sc.Unset > 0)
            {
                throw new Exception("Unable to set all task times.");
            }
        }
        public void TestFindCircleNum()
        {
            var M = new int[, ]
            {
                { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
                { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 },
                { 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
                { 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0 },
                { 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0 },
                { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1 },
                { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
                { 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }
            };

            SetCount.FindCircleNum(M);
        }