Example #1
0
        public void CheckDiscardCandidateFollowingSingleOptions(Candidate k, out Requirement c, out int o)
        {
            if (k != null)
            {
                DiscardCandidate(k);
            }
            int sc = tsc;

            c = FollowSingleOptions();
            o = 1;
            if (c != null)
            {
                o = c.s;
            }
            while (tsc > sc)
            {
                UnselectCandidate();
            }
            UndiscardCandidate(k);
        }
Example #2
0
        public void CheckSelectCandidateFollowingSingleOptions(Candidate k, out Requirement c, out int o, out int steps)
        {
            int sc = tsc;

            if (k != null)
            {
                SelectCandidate(k);
            }
            c     = FollowSingleOptions();
            steps = tsc - sc;
            o     = 1;
            if (c != null)
            {
                o = c.s;
            }
            while (tsc > sc)
            {
                UnselectCandidate();
            }
        }
Example #3
0
        public void AddCandidate(Requirement c)
        {
            Tile t = new Tile();

            t.k = this;
            if (tile == null)
            {
                tile = t;
            }
            else
            {
                tile.r.l = t;
                t.r      = tile.r;
                tile.r   = t;
                t.l      = tile;
            }
            t.c = c;
            c.s++;
            t.d        = c.d;
            c.d.u      = t;
            c.d        = t;
            t.u        = c;
            t.included = true;
        }
Example #4
0
        /*
         * public static Tile AddToCandidate<C>(Tile x, Requirement c)
         * {
         *  Tile t = new Tile();
         *  t.ClearTile();
         *  if (x != null)
         *  {
         *      x.r.l = t;
         *      t.r = x.r;
         *      x.r = t;
         *      t.l = x;
         *  }
         *  t.c = c;
         *  c.s++;
         *  t.d = c.d;
         *  c.d.u = t;
         *  c.d = t;
         *  t.u = c;
         *  t.included = true;
         *  return t;
         * }
         */

        protected void ClearTile()
        {
            l        = r = u = d = this;
            c        = null;
            included = false;
        }
Example #5
0
 public ImpossibleHint(Requirement c)
 {
     this.c = c;
 }
Example #6
0
 public SelectableHint(Candidate r, Requirement c)
 {
     this.r = r;
     this.c = c;
 }
Example #7
0
 public DiscardableHint(Candidate r, Requirement c, bool eventual)
 {
     this.r        = r;
     this.c        = c;
     this.eventual = eventual;
 }
Example #8
0
 public override void PaintBackground(HintPainter context)
 {
     Requirement.PaintBackground(context, Hint.Kind.AmongMust);
     Candidate.PaintBackground(context, Hint.Kind.Must);
 }
Example #9
0
 public ForcedMoveHint(Requirement c, Candidate r)
 {
     this.c = c;
     this.r = r;
 }