Esempio n. 1
0
        private void OnActorLocationChanged(object sender,
            LocationChangedEventArgs args)
        {
            Actor actor = (Actor) sender;
            Location new_loc = args.NewLocation;
            Location old_loc = args.OldLocation;

            this[old_loc.Position].Actor = null;
            RaiseGridChanged (old_loc.Position);

            if (new_loc != null) {
                this[new_loc.Position].Actor = actor;
                RaiseGridChanged (new_loc.Position);
            }
        }
Esempio n. 2
0
        private void OnItemLocationChanged(object sender,
            LocationChangedEventArgs args)
        {
            Item item = (Item) sender;

            Location new_loc = args.NewLocation;
            Location old_loc = args.OldLocation;

            if (old_loc != null) {
                this[old_loc.Position].Item = null;
                RaiseGridChanged (old_loc.Position);
            }

            if (new_loc != null) {
                this[new_loc.Position].Item = item;
                RaiseGridChanged (new_loc.Position);
            }
        }
Esempio n. 3
0
 private void CenterLocationChangedHandler(object sender,
     LocationChangedEventArgs args)
 {
     map = args.NewLocation.Map;
     recenter = true;
 }