Пример #1
0
 private void btnTeleportLocation_Click(object sender, EventArgs e)
 {
     if (lvLocations.SelectedItems.Count > 0)
     {
         TeleportLocation location = lvLocations.SelectedItems[0].Tag as TeleportLocation;
         helper.TeleportToLocation(location);
     }
 }
Пример #2
0
 private void btnRemoveLocation_Click(object sender, EventArgs e)
 {
     if (lvLocations.SelectedItems.Count > 0)
     {
         TeleportLocation location = lvLocations.SelectedItems[0].Tag as TeleportLocation;
         lvLocations.Items.Remove(lvLocations.SelectedItems[0]);
         helper.Locations.Remove(location);
     }
 }
Пример #3
0
        public bool TeleportToLocation(TeleportLocation location)
        {
            if (location != null)
            {
                TeleportToPosition(location.Position);
                LastLocation = location;
                return(true);
            }

            return(false);
        }
Пример #4
0
        public TeleportLocation AddCurrentLocation(string locationName)
        {
            TeleportLocation location = null;

            if (!string.IsNullOrEmpty(locationName))
            {
                location = FindLocation(locationName);

                if (location != null)
                {
                    location.Position = Me.position;
                }
                else
                {
                    Locations.Add(new TeleportLocation(locationName));
                }
            }

            return(location);
        }
Пример #5
0
        public bool TeleportToLocation(string locationName)
        {
            TeleportLocation location = FindLocation(locationName);

            return(TeleportToLocation(location));
        }