コード例 #1
0
            public void Tick(ActorMap actorMap)
            {
                if (!Dirty)
                {
                    return;
                }

                var oldActors = currentActors;

                currentActors = Footprint.SelectMany(actorMap.GetActorsAt).ToList();

                var entered = currentActors.Except(oldActors);
                var exited  = oldActors.Except(currentActors);

                if (onActorEntered != null)
                {
                    foreach (var a in entered)
                    {
                        onActorEntered(a);
                    }
                }

                if (onActorExited != null)
                {
                    foreach (var a in exited)
                    {
                        onActorExited(a);
                    }
                }

                Dirty = false;
            }
コード例 #2
0
ファイル: ActorMap.cs プロジェクト: Walkman-Mirror/OpenRA
            public void Tick(ActorMap am)
            {
                if (!Dirty)
                {
                    return;
                }

                var oldActors = currentActors;
                var delta     = new WVec(range, range, WDist.Zero);

                currentActors = am.ActorsInBox(position - delta, position + delta)
                                .Where(a => (a.CenterPosition - position).HorizontalLengthSquared < range.LengthSquared)
                                .ToList();

                var entered = currentActors.Except(oldActors);
                var exited  = oldActors.Except(currentActors);

                if (onActorEntered != null)
                {
                    foreach (var a in entered)
                    {
                        onActorEntered(a);
                    }
                }

                if (onActorExited != null)
                {
                    foreach (var a in exited)
                    {
                        onActorExited(a);
                    }
                }

                Dirty = false;
            }
コード例 #3
0
ファイル: ActorMap.cs プロジェクト: wytsep/OpenRA
            public void Tick(ActorMap am)
            {
                if (!Dirty)
                {
                    return;
                }

                var oldActors = currentActors;
                var delta     = new WVec(Range, Range, WRange.Zero);

                currentActors = am.ActorsInBox(Position - delta, Position + delta)
                                .Where(a => (a.CenterPosition - Position).HorizontalLengthSquared < Range.Range * Range.Range)
                                .ToList();

                var entered = currentActors.Except(oldActors);
                var exited  = oldActors.Except(currentActors);

                foreach (var a in entered)
                {
                    onActorEntered(a);
                }

                foreach (var a in exited)
                {
                    onActorExited(a);
                }

                Dirty = false;
            }
コード例 #4
0
ファイル: ActorMap.cs プロジェクト: RobotCaleb/OpenRA
            public void Tick(ActorMap am)
            {
                if (!Dirty)
                    return;

                var oldActors = currentActors;
                var delta = new WVec(Range, Range, WRange.Zero);
                currentActors = am.ActorsInBox(Position - delta, Position + delta)
                    .Where(a => (a.CenterPosition - Position).HorizontalLengthSquared < Range.Range * Range.Range)
                    .ToList();

                var entered = currentActors.Except(oldActors);
                var exited = oldActors.Except(currentActors);

                foreach (var a in entered)
                    onActorEntered(a);

                foreach (var a in exited)
                    onActorExited(a);

                Dirty = false;
            }
コード例 #5
0
ファイル: ActorMap.cs プロジェクト: RobotCaleb/OpenRA
            public void Tick(ActorMap am)
            {
                if (!Dirty)
                    return;

                var oldActors = currentActors;
                currentActors = Footprint.SelectMany(c => am.GetUnitsAt(c)).ToList();

                var entered = currentActors.Except(oldActors);
                var exited = oldActors.Except(currentActors);

                if (onActorEntered != null)
                    foreach (var a in entered)
                        onActorEntered(a);

                if (onActorExited != null)
                    foreach (var a in exited)
                        onActorExited(a);

                Dirty = false;
            }
コード例 #6
0
ファイル: ActorMap.cs プロジェクト: rhamilton1415/OpenRA
            public void Tick(ActorMap am)
            {
                if (!Dirty)
                    return;

                var oldActors = currentActors;
                var delta = new WVec(range, range, WDist.Zero);
                currentActors = am.ActorsInBox(position - delta, position + delta)
                    .Where(a => (a.CenterPosition - position).HorizontalLengthSquared < range.LengthSquared)
                    .ToList();

                var entered = currentActors.Except(oldActors);
                var exited = oldActors.Except(currentActors);

                if (onActorEntered != null)
                    foreach (var a in entered)
                        onActorEntered(a);

                if (onActorExited != null)
                    foreach (var a in exited)
                        onActorExited(a);

                Dirty = false;
            }