Beispiel #1
0
        public virtual object Clone()
        {
            Geometry3D NewGeom = new Geometry3D(Name);

            NewGeom.Shader          = Shader == null ? null : (BasicEffect)Shader.Clone();
            NewGeom.CollisionBuffer = CollisionBuffer == null ? null : (Vector3[])CollisionBuffer.Clone();
            NewGeom.Position        = new Vector3(Position.X, Position.Y, Position.Z);
            NewGeom.RenderBucket    = RenderBucket;
            NewGeom.HasCull         = HasCull;
            NewGeom.TextureNames.AddRange(TextureNames);
            return(NewGeom);
        }
 // GameState constructor
 public GameState()
 {
     Towers = new List <Tower> ();
     actors = new ConcurrentDictionary <int, Actor>();
     OutgoingReliableElements = new ConcurrentQueue <UpdateElement>();
     CollisionBuffer          = new CollisionBuffer(this);
     teamLives = new int[MAXTEAMS];
     for (int i = 0; i < teamLives.Length; i++)
     {
         teamLives[i] = 5;
     }
     teamActors = new List <Actor> [MAXTEAMS];
     for (int i = 0; i < teamActors.Length; i++)
     {
         teamActors[i] = new List <Actor>();
     }
     Log.D("Game State created.");
 }
        public void Execute(CollisionEvent collisionEvent)
        {
            if (m_collisions.HasComponent(collisionEvent.EntityA))
            {
                var buffer = new CollisionBuffer()
                {
                    entity = collisionEvent.EntityB,
                };
                m_collisions[collisionEvent.EntityA].Add(buffer);
            }

            if (m_collisions.HasComponent(collisionEvent.EntityB))
            {
                var buffer = new CollisionBuffer()
                {
                    entity = collisionEvent.EntityA,
                };
                m_collisions[collisionEvent.EntityB].Add(buffer);
            }
        }