/// <summary> /// Obtains the players current zone id. /// </summary> /// <returns></returns> public Int16 GetZoneId() { // Read main map data pointer.. var ptrBuffer = new byte[4]; Memory.Peek(process, pointerFactory["ZONEID" + process.MainWindowTitle], ptrBuffer); Memory.Peek(process, (IntPtr)BitConverter.ToInt32(ptrBuffer, 0), ptrBuffer); // Read map id offset.. var offBuffer = new byte[4]; Memory.Peek(process, pointerFactory["ZONEID" + process.MainWindowTitle] + 7, offBuffer); // Read map id.. var zoneBuffer = new byte[2]; Memory.Peek(process, (IntPtr)BitConverter.ToInt32(ptrBuffer, 0) + BitConverter.ToInt32(offBuffer, 0), zoneBuffer); ZoneChangedEventArgs args = new ZoneChangedEventArgs(); args.ZoneID = BitConverter.ToInt16(zoneBuffer, 0); args.PlayerName = BackupName; args.Player = this; if (zone != args.ZoneID) { zone = args.ZoneID; OnZoneChange(args); } return(BitConverter.ToInt16(zoneBuffer, 0)); }
public void ZoneChangedEventArgsConstructorTest() { Zone zone = new Zone(); ZoneChangedEventArgs target = new ZoneChangedEventArgs(zone); Assert.AreSame(zone, target.Zone); }
private void OnCardRemoved(object sender, ZoneChangedEventArgs e) { var viewModel = _cards.Single(x => x.Card == e.Card); _cards.Remove(viewModel); viewModel.Close(); ViewModels.SelectableCard.Destroy(viewModel); }
private void OnCardRemoved(object sender, ZoneChangedEventArgs e) { var viewModel = _cards.Single(x => x.Card == e.Card); _cards.Remove(viewModel); viewModel.Close(); ViewModels.SelectableCard.Destroy(viewModel); }
private void securityModule_ZoneChanged(object sender, ZoneChangedEventArgs e) { WriteLine("Zone changed: " + e.Zone); _zoneInfos[e.Zone.Id - 1].IsFaulted = e.Zone.IsFaulted; _zoneInfos[e.Zone.Id - 1].ZoneID = e.Zone.Id; _zoneInfos[e.Zone.Id - 1].ZoneName = e.Zone.Name; }
/// <summary> /// Event : ZoneChanged /// </summary> /// <param name="sender">object</param> /// <param name="e">ZoneChangedEventArgs</param> private void Locator_ZoneChanged(object sender, ZoneChangedEventArgs e) { /// <param name="BoundState">An enumeration of type BoundaryState.</param> /// <param name="Latitude">The latitude value [-90.0 ~ 90.0] (degrees).</param> /// <param name="Longitude">The longitude value [-180.0 ~ 180.0] (degrees).</param> /// <param name="Altitude">The altitude value.</param> /// <param name="Timestamp">The timestamp value.</param> textMessage.Text = "[Boundary]\n Timestamp : " + e.Timestamp + "\n BoundState : " + e.BoundState + "\n Latitude : " + e.Latitude + "\n Longitude : " + e.Longitude; }
protected virtual void OnZoneChange(ZoneChangedEventArgs e) { EventHandler <ZoneChangedEventArgs> handler = ZoneChanged; if (handler != null) { handler(this, e); } }
private void OnCardRemoved(object sender, ZoneChangedEventArgs e) { var viewModel = GetPermanent(e.Card); viewModel.OnPermanentLeftBattlefield(); ViewModels.Permanent.Destroy(viewModel); Remove(viewModel); }
/// <summary> /// Event : ZoneChanged /// </summary> /// <param name="sender">object</param> /// <param name="e">ZoneChangedEventArgs</param> public static void LocatorZoneChanged(object sender, ZoneChangedEventArgs e) { /// <param name="BoundState">An enumeration of type BoundaryState.</param> /// <param name="Latitude">The latitude value [-90.0 ~ 90.0] (degrees).</param> /// <param name="Longitude">The longitude value [-180.0 ~ 180.0] (degrees).</param> /// <param name="Altitude">The altitude value.</param> /// <param name="Timestamp">The timestamp value.</param> textMessage.TextColor = Color.YellowGreen; textMessage.Text = "[Boundary : " + e.BoundState + "] Success\nlatitude : " + e.Latitude + "\nlongitude : " + e.Longitude; }
private void OnCardAdded(object sender, ZoneChangedEventArgs e) { _cards.Add(ViewModels.SelectableCard.Create(e.Card)); }
private void OnCardAdded(object sender, ZoneChangedEventArgs e) { AddCard(e.Card); }
public void ZoneChangedEventArgsConstructorNullTest() { ZoneChangedEventArgs target = new ZoneChangedEventArgs(null); Assert.Fail("No exception raised."); }
private void OnCardAdded(object sender, ZoneChangedEventArgs e) { AddCard(e.Card); }
private void OnCardAdded(object sender, ZoneChangedEventArgs e) { _cards.Add(ViewModels.SelectableCard.Create(e.Card)); }