public ActorLayer(int x, int y, int layerWidth, int layerHeight, int s, bool bounded) : base(x, y, layerWidth, layerHeight) { this.collisionChecker = new CollisionManager(); this.objects = new ActorTreeSet(); this.cellSize = s; this.Initialize(layerWidth, layerHeight, s); this.isBounded = bounded; }
/// <summary> /// 刷新缓存数据,重置世界 /// </summary> /// public void Reset() { if (isClose) { return; } if (objects != null) { lock (objects) { if (objects != null) { objects.Clear(); objects = null; } if (collisionChecker != null) { collisionChecker.Clear(); collisionChecker = null; } this.collisionChecker = new CollisionManager(); this.objects = new ActorTreeSet(); } } }