private async Task <uint> GetSceneID(CancellationToken token) { var xVal = await SwitchConnection.PointerPeek(1, Offsets.SceneIDPointer, token).ConfigureAwait(false); var xParsed = BitConverter.ToUInt32(xVal, 0); return(xParsed); }
private async Task <TradePartnerBS> GetTradePartnerInfo(CancellationToken token) { var id = await SwitchConnection.PointerPeek(4, Offsets.LinkTradePartnerIDPointer, token).ConfigureAwait(false); var name = await SwitchConnection.PointerPeek(TradePartnerBS.MaxByteLengthStringObject, Offsets.LinkTradePartnerNamePointer, token).ConfigureAwait(false); return(new TradePartnerBS(id, name)); }
public async Task <SAV8BS> GetFakeTrainerSAV(CancellationToken token) { var sav = new SAV8BS(); var info = sav.MyStatus; // Set the OT. var name = await SwitchConnection.PointerPeek(TradePartnerBS.MaxByteLengthStringObject, Offsets.MyStatusTrainerPointer, token).ConfigureAwait(false); info.OT = TradePartnerBS.ReadStringFromRAMObject(name); // Set the TID, SID, and Language var id = await SwitchConnection.PointerPeek(4, Offsets.MyStatusTIDPointer, token).ConfigureAwait(false); info.TID = BitConverter.ToUInt16(id, 0); info.SID = BitConverter.ToUInt16(id, 2); var lang = await SwitchConnection.PointerPeek(1, Offsets.ConfigLanguagePointer, token).ConfigureAwait(false); sav.Language = lang[0]; return(sav); }
public async Task <TextSpeedOption> GetTextSpeed(CancellationToken token) { var data = await SwitchConnection.PointerPeek(1, Offsets.ConfigTextSpeedPointer, token).ConfigureAwait(false); return((TextSpeedOption)data[0]); }
public async Task <ulong> GetTradePartnerNID(CancellationToken token) => BitConverter.ToUInt64(await SwitchConnection.PointerPeek(sizeof(ulong), Offsets.LinkTradePartnerNIDPointer, token).ConfigureAwait(false), 0);
// Whenever we're in a trade, this pointer will be loaded, otherwise 0 public async Task <bool> IsPartnerParamLoaded(CancellationToken token) { var byt = await SwitchConnection.PointerPeek(8, Offsets.LinkTradePartnerParamPointer, token).ConfigureAwait(false); return(BitConverter.ToUInt64(byt, 0) != 0); }
private async Task <bool> IsSceneID(uint expected, CancellationToken token) { var byt = await SwitchConnection.PointerPeek(1, Offsets.SceneIDPointer, token).ConfigureAwait(false); return(byt[0] == expected); }