Esempio n. 1
0
        public Point? GetVisiblePoint(PointULong point, bool nullIfUnvisible)
        {
            var windowPoint = point - AbsoluteLocation;
            var dimension = Dimension;

            var isInVisibleArea = windowPoint.X >= 0 && windowPoint.Y >= 0
                && windowPoint.X <= dimension.X && windowPoint.Y <= dimension.Y;

            if (isInVisibleArea || !nullIfUnvisible)
                return windowPoint;

            return null;
        }
Esempio n. 2
0
 public Cell(PointULong location)
 {
     Location = location;
 }
Esempio n. 3
0
 public void Reset(PointULong absoluteView)
 {
     _absoluteView = absoluteView;
     _offsetView = new Point();
 }
Esempio n. 4
0
 public ScreenLocation(PointULong absoluteView)
 {
     _absoluteView = absoluteView;
     Scale = 1;
 }
Esempio n. 5
0
 /// <summary>
 /// Load alive points
 /// </summary>
 /// <param name="alive">Alive points</param>
 /// <param name="offset">Global offset of all points</param>
 public void Load(List<Point> alive, PointULong offset)
 {
     _stop = true;
     _aliveCells.Clear();
     _aroundAliveCells.Clear();
     var aliveUPoints = alive.Select(i => offset + i);
     SetAlive(aliveUPoints);
     _myFireUpdater.Invoke(aliveUPoints.ToList());
 }