示例#1
0
            public void Reset(SelectedChangeTracker tracker)
            {
                NoCount    = 0;
                YesCount   = 0;
                MaybeCount = 0;
                foreach (var index in topology.GetIndices())
                {
                    var selected = tracker.GetTristate(index);
                    switch (selected)
                    {
                    case Tristate.No: NoCount++; break;

                    case Tristate.Maybe: MaybeCount++; break;

                    case Tristate.Yes: YesCount++; break;
                    }
                }
            }
示例#2
0
        public void Init(TilePropagator propagator)
        {
            tileset       = propagator.CreateTileSet(Tiles);
            nearbyTracker = new NearbyTracker {
                MinDistance = MinDistance, Topology = propagator.Topology
            };
            changeTracker = propagator.CreateSelectedChangeTracker(tileset, nearbyTracker);

            // Review the initial state
            foreach (var index in propagator.Topology.GetIndices())
            {
                if (changeTracker.GetTristate(index).IsYes())
                {
                    nearbyTracker.VisitNearby(index, false);
                }
            }

            Check(propagator);
        }