Ejemplo n.º 1
0
        private void OnEntityMoved(object sender, Entity.EntityMovedEventArgs args)
        {
            Entities.Move(args.Entity as Entity, args.Entity.Position);

            if (GameLoop.World.players.ContainsKey(GameLoop.NetworkingManager.myUID))
            {
                GameLoop.UIManager.CenterOnActor(GameLoop.World.players[GameLoop.NetworkingManager.myUID]);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles pathfinding walkability view syncing for entities
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnEntityMoved(object sender, Entity.EntityMovedEventArgs args)
        {
            // Reset from position
            Walkability[args.FromPosition.Y * Width + args.FromPosition.X] = true;
            // Set new position
            Walkability[args.Entity.Position.Y * Width + args.Entity.Position.X] = false;

            // Recalculate field of view
            if (args.Entity is Actor actor)
            {
                actor.FieldOfView.Calculate();
            }
        }
Ejemplo n.º 3
0
Archivo: Map.cs Proyecto: bgudna/urukx
 // When the Entity's .Moved value changes, it triggers this event handler
 // which updates the Entity's current position in the SpatialMap
 private void OnEntityMoved(object sender, Entity.EntityMovedEventArgs args)
 {
     Entities.Move(args.Entity as Entity, args.Entity.Position);
 }
Ejemplo n.º 4
0
 private void Entity_Moved(object sender, Entity.EntityMovedEventArgs e) =>
 EvaluateEntityState((Entity)sender);