Exemplo n.º 1
0
        public GameObjectCounter()
            : base()
        {
            Stats                    = new GameObjectStatistics();
            Stats.UpdateCount        = 0;
            Stats.DrawCount          = 0;
            Stats.CollisionTestCount = 0;
            Stats.CollisionCount     = 0;
            this.SetDrawSize(32, 32);

            this.ObjectCollision += new GameObjectCollisionEventHandler(GameObject_ObjectCollision);
        }
Exemplo n.º 2
0
        public GameObjectCounter()
            : base()
        {
            Stats = new GameObjectStatistics();
            Stats.UpdateCount = 0;
            Stats.DrawCount = 0;
            Stats.CollisionTestCount = 0;
            Stats.CollisionCount = 0;
            this.SetDrawSize(32, 32);

            this.ObjectCollision += new GameObjectCollisionEventHandler(GameObject_ObjectCollision);
        }
Exemplo n.º 3
0
        private GameObjectStatistics GetObjectTotals(SceneGraph graph)
        {
            GameObjectStatistics stats = new GameObjectStatistics();

            foreach (IGameObjectCounter obj in graph.RootGraph)
            {
                stats.CollisionCount += obj.Stats.CollisionCount;
                stats.CollisionTestCount += obj.Stats.CollisionTestCount;
                stats.DrawCount += obj.Stats.DrawCount;
                stats.UpdateCount += obj.Stats.UpdateCount;
            }

            return stats;
        }