diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index 63c642db9..13abbe738 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -1,8 +1,8 @@ - + AnyCPU net472 - 8.0 + 9.0 AnyCPU;x64 diff --git a/Dalamud/Game/ClientState/JobGauge.cs b/Dalamud/Game/ClientState/JobGauge.cs deleted file mode 100644 index 70a142e98..000000000 --- a/Dalamud/Game/ClientState/JobGauge.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Runtime.InteropServices; -using Serilog; - -namespace Dalamud.Game.ClientState { - public class JobGauges { - private ClientStateAddressResolver Address { get; } - - public JobGauges(ClientStateAddressResolver addressResolver) { - Address = addressResolver; - - Log.Verbose("JobGaugeData address {JobGaugeData}", Address.JobGaugeData); - } - - // Should only be called with the gauge types in - // ClientState.Structs.JobGauge - public T Get() { - return Marshal.PtrToStructure(Address.JobGaugeData); - } - } -} diff --git a/Dalamud/Game/ClientState/JobGauges.cs b/Dalamud/Game/ClientState/JobGauges.cs new file mode 100644 index 000000000..f25f5d8ab --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauges.cs @@ -0,0 +1,35 @@ +using System.Runtime.InteropServices; + +using Serilog; + +namespace Dalamud.Game.ClientState +{ + /// + /// This class converts in-memory Job gauge data to structs. + /// + public class JobGauges + { + /// + /// Initializes a new instance of the class. + /// + /// Address resolver with the JobGauge memory location(s). + public JobGauges(ClientStateAddressResolver addressResolver) + { + this.Address = addressResolver; + + Log.Verbose("JobGaugeData address {JobGaugeData}", this.Address.JobGaugeData); + } + + private ClientStateAddressResolver Address { get; } + + /// + /// Get the JobGauge for a given job. + /// + /// A JobGauge struct from ClientState.Structs.JobGauge. + /// A JobGauge. + public T Get() + { + return Marshal.PtrToStructure(this.Address.JobGaugeData); + } + } +} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs index e6eca6548..c37e1c0a7 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs @@ -1,25 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory AST job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct ASTGauge { - [FieldOffset(4)] private CardType Card; - [FieldOffset(5)] private unsafe fixed byte Seals[3]; + public struct ASTGauge + { + [FieldOffset(4)] + private CardType card; - public CardType DrawnCard() { - return Card; - } + [FieldOffset(5)] + private unsafe fixed byte seals[3]; - public unsafe bool ContainsSeal(SealType seal) { - if (Seals[0] == (byte)seal) return true; - if (Seals[1] == (byte)seal) return true; - if (Seals[2] == (byte)seal) return true; + /// + /// Gets the currently drawn . + /// + /// Currently drawn . + public CardType DrawnCard() => this.card; + + /// + /// Check if a is currently active on the divination gauge. + /// + /// The to check for. + /// If the given Seal is currently divined. + public unsafe bool ContainsSeal(SealType seal) + { + if (this.seals[0] == (byte)seal) return true; + if (this.seals[1] == (byte)seal) return true; + if (this.seals[2] == (byte)seal) return true; return false; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs index 8bbb74610..694a0d981 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs @@ -1,34 +1,59 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory BLM job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct BLMGauge { - [FieldOffset(0)] public short TimeUntilNextPolyglot; //eno timer (ms) - [FieldOffset(2)] public short ElementTimeRemaining; //ui/af timer - [FieldOffset(4)] private byte ElementStance; //ui/af - [FieldOffset(5)] public byte NumUmbralHearts; //number of umbral hearts - [FieldOffset(6)] public byte NumPolyglotStacks; //number of polyglot stacks - [FieldOffset(7)] private byte EnoState; //eno active? + public struct BLMGauge + { + /// + /// Gets the time until the next Polyglot stack in milliseconds. + /// + [FieldOffset(0)] + public short TimeUntilNextPolyglot; // enochian timer - public bool InUmbralIce() { - return ElementStance > 4; - } + /// + /// Gets the time remaining for Astral Fire or Umbral Ice in milliseconds. + /// + [FieldOffset(2)] + public short ElementTimeRemaining; // umbral ice and astral fire timer - public bool InAstralFire() { - return ElementStance > 0 && ElementStance < 4; - } + [FieldOffset(4)] + private byte elementStance; // umbral ice or astral fire - public bool IsEnoActive() { - return EnoState > 0; - } + /// + /// Gets the number of Umbral Hearts remaining. + /// + [FieldOffset(5)] + public byte NumUmbralHearts; + /// + /// Gets the number of Polyglot stacks remaining. + /// + [FieldOffset(6)] + public byte NumPolyglotStacks; + + [FieldOffset(7)] + private byte enochianState; + + /// + /// Gets if the player is in Umbral Ice. + /// + /// true or false. + public bool InUmbralIce() => this.elementStance > 4; + + /// + /// Gets if the player is in Astral fire. + /// + /// true or false. + public bool InAstralFire() => this.elementStance > 0 && this.elementStance < 4; + + /// + /// Gets if Enochian is active. + /// + /// true or false. + public bool IsEnoActive() => this.enochianState > 0; } - - } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs index b181d57a0..3fe2b5dee 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs @@ -1,17 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory BRD job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct BRDGauge { - [FieldOffset(0)] public short SongTimer; - [FieldOffset(2)] public byte NumSongStacks; - [FieldOffset(3)] public byte SoulVoiceValue; - [FieldOffset(4)] public CurrentSong ActiveSong; + public struct BRDGauge + { + /// + /// Gets the current song timer in milliseconds. + /// + [FieldOffset(0)] + public short SongTimer; + + /// + /// Gets the number of stacks for the current song. + /// + [FieldOffset(2)] + public byte NumSongStacks; + + /// + /// Gets the amount of Soul Voice accumulated. + /// + [FieldOffset(3)] + public byte SoulVoiceValue; + + /// + /// Gets the type of song that is active. + /// + [FieldOffset(4)] + public CurrentSong ActiveSong; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs index b77e6f0e4..8e4484871 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs @@ -1,25 +1,43 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory DNC job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public unsafe struct DNCGauge { - [FieldOffset(0)] public byte NumFeathers; - [FieldOffset(1)] public byte Esprit; - [FieldOffset(2)] private fixed byte StepOrder[4]; - [FieldOffset(6)] public byte NumCompleteSteps; + public unsafe struct DNCGauge + { + /// + /// Gets the number of feathers available. + /// + [FieldOffset(0)] + public byte NumFeathers; - public bool IsDancing() { - return StepOrder[0] != 0; - } + /// + /// Gets the amount of Espirit available. + /// + [FieldOffset(1)] + public byte Esprit; - public ulong NextStep() { - return (ulong)(15999 + StepOrder[NumCompleteSteps] - 1); - } + [FieldOffset(2)] + private fixed byte stepOrder[4]; + + /// + /// Gets the number of steps completed for the current dance. + /// + [FieldOffset(6)] + public byte NumCompleteSteps; + + /// + /// Gets the next step in the current dance. + /// + public ulong NextStep => (ulong)(15999 + this.stepOrder[this.NumCompleteSteps] - 1); + + /// + /// Gets if the player is dancing or not. + /// + /// true or false. + public bool IsDancing() => this.stepOrder[0] != 0; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs index fa71eb541..101c483b0 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs @@ -1,16 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory DRG job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct DRGGauge { - [FieldOffset(0)] public short BOTDTimer; - [FieldOffset(2)] public BOTDState BOTDState; - [FieldOffset(3)] public byte EyeCount; + public struct DRGGauge + { + /// + /// Gets the time remaining for Blood of the Dragon in milliseconds. + /// + [FieldOffset(0)] + public short BOTDTimer; + + /// + /// Gets the current state of Blood of the Dragon. + /// + [FieldOffset(2)] + public BOTDState BOTDState; + + /// + /// Gets the count of eyes opened during Blood of the Dragon. + /// + [FieldOffset(3)] + public byte EyeCount; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs index 1cc8bed4d..9c5306764 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs @@ -1,20 +1,38 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory DRK job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct DRKGauge { - [FieldOffset(0)] public byte Blood; - [FieldOffset(2)] public ushort DarksideTimeRemaining; - [FieldOffset(4)] private byte DarkArtsState; - [FieldOffset(6)] public ushort ShadowTimeRemaining; + public struct DRKGauge + { + /// + /// Gets the amount of blood accumulated. + /// + [FieldOffset(0)] + public byte Blood; - public bool HasDarkArts() { - return DarkArtsState > 0; - } + /// + /// Gets the Darkside time remaining in milliseconds. + /// + [FieldOffset(2)] + public ushort DarksideTimeRemaining; + + [FieldOffset(4)] + private byte darkArtsState; + + /// + /// Gets the Shadow time remaining in milliseconds. + /// + [FieldOffset(6)] + public ushort ShadowTimeRemaining; + + /// + /// Gets if the player has Dark Arts or not. + /// + /// true or false. + public bool HasDarkArts() => this.darkArtsState > 0; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs index 969adda1d..c1f7e496b 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs @@ -1,16 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory GNB job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct GNBGauge { - [FieldOffset(0)] public byte NumAmmo; - [FieldOffset(2)] public short MaxTimerDuration; - [FieldOffset(4)] public byte AmmoComboStepNumber; + public struct GNBGauge + { + /// + /// Gets the amount of ammo available. + /// + [FieldOffset(0)] + public byte NumAmmo; + + /// + /// Gets the max combo time of the Gnashing Fang combo. + /// + [FieldOffset(2)] + public short MaxTimerDuration; + + /// + /// Gets the current step of the Gnashing Fang combo. + /// + [FieldOffset(4)] + public byte AmmoComboStepNumber; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs b/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs index 69762e295..4c6ab351a 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs @@ -1,67 +1,272 @@ using System; -namespace Dalamud.Game.ClientState.Structs.JobGauge { - public enum SealType : byte { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + #region AST + + /// + /// AST Divination seal types. + /// + public enum SealType : byte + { + /// + /// No seal. + /// NONE = 0, - SUN, - MOON, - CELESTIAL + + /// + /// Sun seal. + /// + SUN = 1, + + /// + /// Moon seal. + /// + MOON = 2, + + /// + /// Celestial seal. + /// + CELESTIAL = 3, } - public enum CardType : byte { + /// + /// AST Arcanum (card) types. + /// + public enum CardType : byte + { + /// + /// No card. + /// NONE = 0, - BALANCE, - BOLE, - ARROW, - SPEAR, - EWER, - SPIRE, + + /// + /// The Balance card. + /// + BALANCE = 1, + + /// + /// The Bole card. + /// + BOLE = 2, + + /// + /// The Arrow card. + /// + ARROW = 3, + + /// + /// The Spear card. + /// + SPEAR = 4, + + /// + /// The Ewer card. + /// + EWER = 5, + + /// + /// The Spire card. + /// + SPIRE = 6, + + /// + /// The Lord of Crowns card. + /// LORD = 0x70, - LADY = 0x80 + + /// + /// The Lady of Crowns card. + /// + LADY = 0x80, } - public enum SummonPet : byte { + #endregion + + #region BRD + + /// + /// BRD Current Song types. + /// + public enum CurrentSong : byte + { + /// + /// No song is active type. + /// NONE = 0, - IFRIT = 3, - TITAN, - GARUDA - } - public enum PetGlam : byte { - NONE = 0, - EMERALD, - TOPAZ, - RUBY - } - - [Flags] - public enum Sen : byte { - NONE = 0, - SETSU = 1 << 0, - GETSU = 1 << 1, - KA = 1 << 2 - } - - public enum BOTDState : byte { - NONE = 0, - BOTD, - LOTD - } - - public enum CurrentSong : byte { + /// + /// Mage's Ballad type. + /// MAGE = 5, + + /// + /// Army's Paeon type. + /// ARMY = 0xA, - WANDERER = 0xF + + /// + /// The Wanderer's Minuet type. + /// + WANDERER = 0xF, } - public enum DismissedFairy : byte { - EOS = 6, - SELENE + #endregion + + #region DRG + + /// + /// DRG Blood of the Dragon state types. + /// + public enum BOTDState : byte + { + /// + /// Inactive type. + /// + NONE = 0, + + /// + /// Blood of the Dragon is active. + /// + BOTD = 1, + + /// + /// Life of the Dragon is active. + /// + LOTD = 2, } - public enum Mudras : byte { + #endregion + + #region NIN + + /// + /// NIN Mudra types. + /// + public enum Mudras : byte + { + /// + /// Ten mudra. + /// TEN = 1, + + /// + /// Chi mudra. + /// CHI = 2, - JIN = 3 + + /// + /// Jin mudra. + /// + JIN = 3, } + + #endregion + + #region SAM + + /// + /// Samurai Sen types. + /// + [Flags] + public enum Sen : byte + { + /// + /// No Sen. + /// + NONE = 0, + + /// + /// Setsu Sen type. + /// + SETSU = 1 << 0, + + /// + /// Getsu Sen type. + /// + GETSU = 1 << 1, + + /// + /// Ka Sen type. + /// + KA = 1 << 2, + } + + #endregion + + #region SCH + + /// + /// SCH Dismissed fairy types. + /// + public enum DismissedFairy : byte + { + /// + /// Dismissed fairy is Eos. + /// + EOS = 6, + + /// + /// Dismissed fairy is Selene. + /// + SELENE = 7, + } + + #endregion + + #region SMN + + /// + /// SMN summoned pet types. + /// + public enum SummonPet : byte + { + /// + /// No pet. + /// + NONE = 0, + + /// + /// The summoned pet Ifrit. + /// + IFRIT = 3, + + /// + /// The summoned pet Titan. + /// + TITAN = 4, + + /// + /// The summoned pet Garuda. + /// + GARUDA = 5, + } + + /// + /// SMN summoned pet glam types. + /// + public enum PetGlam : byte + { + /// + /// No pet glam. + /// + NONE = 0, + + /// + /// Emerald carbuncle pet glam. + /// + EMERALD = 1, + + /// + /// Topaz carbuncle pet glam. + /// + TOPAZ = 2, + + /// + /// Ruby carbuncle pet glam. + /// + RUBY = 3, + } + + #endregion } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs index e606cb751..18f684c21 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs @@ -1,27 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory MCH job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct MCHGauge{ + public struct MCHGauge + { + /// + /// Gets the time time remaining for Overheat in milliseconds. + /// + [FieldOffset(0)] + public short OverheatTimeRemaining; - [FieldOffset(0)] public short OverheatTimeRemaining; - [FieldOffset(2)] public short RobotTimeRemaining; - [FieldOffset(4)] public byte Heat; - [FieldOffset(5)] public byte Battery; - [FieldOffset(6)] public byte LastRobotBatteryPower; - [FieldOffset(7)] private byte TimerActive; + /// + /// Gets the time remaining for the Rook or Queen in milliseconds. + /// + [FieldOffset(2)] + public short RobotTimeRemaining; - public bool IsOverheated() { - return (TimerActive & 1) != 0; - } - public bool IsRobotActive() { - return (TimerActive & 2) != 0; - } + /// + /// Gets the current Heat level. + /// + [FieldOffset(4)] + public byte Heat; + + /// + /// Gets the current Battery level. + /// + [FieldOffset(5)] + public byte Battery; + + /// + /// Gets the battery level of the last Robot. + /// + [FieldOffset(6)] + public byte LastRobotBatteryPower; + + [FieldOffset(7)] + private byte timerActive; + + /// + /// Gets if the player is currently Overheated. + /// + /// true or false. + public bool IsOverheated() => (this.timerActive & 1) != 0; + + /// + /// Gets if the player has an active Robot. + /// + /// true or false. + public bool IsRobotActive() => (this.timerActive & 2) != 0; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs index 1d46346ec..177b077fc 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs @@ -3,20 +3,40 @@ using System.Runtime.InteropServices; namespace Dalamud.Game.ClientState.Structs.JobGauge { + /// + /// In-memory MNK job gauge. + /// [StructLayout(LayoutKind.Explicit)] public struct MNKGauge { - [FieldOffset(0)] public byte NumChakra; + /// + /// Gets the number of Chakra available. + /// + [FieldOffset(0)] + public byte NumChakra; + + /// + /// Gets the Greased Lightning timer in milliseconds. + /// + [Obsolete("GL has been removed from the game")] + [FieldOffset(0)] + public byte GLTimer; + + /// + /// Gets the amount of Greased Lightning stacks. + /// + [Obsolete("GL has been removed from the game")] + [FieldOffset(2)] + public byte NumGLStacks; [Obsolete("GL has been removed from the game")] - [FieldOffset(0)] public byte GLTimer; - - [Obsolete("GL has been removed from the game")] - [FieldOffset(2)] public byte NumGLStacks; - - [Obsolete("GL has been removed from the game")] - [FieldOffset(4)] private byte GLTimerFreezeState; + [FieldOffset(4)] + private byte glTimerFreezeState; + /// + /// Gets if the Greased Lightning timer has been frozen. + /// + /// >true or false. [Obsolete("GL has been removed from the game")] public bool IsGLTimerFroze() => false; } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs index 36f9bb268..13eaec09d 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs @@ -3,16 +3,36 @@ using System.Runtime.InteropServices; namespace Dalamud.Game.ClientState.Structs.JobGauge { + /// + /// In-memory NIN job gauge. + /// [StructLayout(LayoutKind.Explicit)] public struct NINGauge { - [FieldOffset(0)] public int HutonTimeLeft; - [FieldOffset(4)] public byte Ninki; + /// + /// Gets the time left on Huton in milliseconds. + /// + // TODO: Probably a short, confirm. + [FieldOffset(0)] + public int HutonTimeLeft; - [Obsolete("Does not appear to be used")] - [FieldOffset(4)] public byte TCJMudrasUsed; + /// + /// Gets the amount of Ninki available. + /// + [FieldOffset(4)] + public byte Ninki; + /// + /// Obsolete. + /// [Obsolete("Does not appear to be used")] - [FieldOffset(6)] public byte NumHutonManualCasts; + [FieldOffset(4)] + public byte TCJMudrasUsed; + + /// + /// Gets the number of times Huton has been cast manually. + /// + [FieldOffset(5)] + public byte NumHutonManualCasts; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs index 30b7f65e3..d3eae81f3 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs @@ -1,14 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory PLD job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct PLDGauge { - [FieldOffset(0)] public byte GaugeAmount; + public struct PLDGauge + { + /// + /// Gets the current level of the Oath gauge. + /// + [FieldOffset(0)] + public byte GaugeAmount; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs index b0a2fa0c6..f72d61d13 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs @@ -1,15 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory RDM job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct RDMGauge { - [FieldOffset(0)] public byte WhiteGauge; - [FieldOffset(1)] public byte BlackGauge; + public struct RDMGauge + { + /// + /// Gets the level of the White gauge. + /// + [FieldOffset(0)] + public byte WhiteGauge; + + /// + /// Gets the level of the Black gauge. + /// + [FieldOffset(1)] + public byte BlackGauge; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs index 74d6e3817..d0796e5c9 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs @@ -1,17 +1,47 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory SAM job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct SAMGauge { + public struct SAMGauge + { + /// + /// Gets the current amount of Kenki available. + /// + [FieldOffset(3)] + public byte Kenki; - [FieldOffset(3)] public byte Kenki; - [FieldOffset(4)] public byte MeditationStacks; - [FieldOffset(5)] public Sen Sen; + /// + /// Gets the amount of Meditation stacks. + /// + [FieldOffset(4)] + public byte MeditationStacks; + + /// + /// Gets the active Sen. + /// + [FieldOffset(5)] + public Sen Sen; + + /// + /// Gets if the Setsu Sen is active. + /// + /// true or false. + public bool HasSetsu() => (this.Sen & Sen.SETSU) != 0; + + /// + /// Gets if the Getsu Sen is active. + /// + /// true or false. + public bool HasGetsu() => (this.Sen & Sen.GETSU) != 0; + + /// + /// Gets if the Ka Sen is active. + /// + /// true or false. + public bool HasKa() => (this.Sen & Sen.KA) != 0; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs index 5d742ee0e..5dc99cf15 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs @@ -1,17 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory SCH job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct SCHGauge { - [FieldOffset(2)] public byte NumAetherflowStacks; - [FieldOffset(3)] public byte FairyGaugeAmount; - [FieldOffset(4)] public short SeraphTimer; - [FieldOffset(6)] public DismissedFairy DismissedFairy; + public struct SCHGauge + { + /// + /// Gets the amount of Aetherflow stacks available. + /// + [FieldOffset(2)] + public byte NumAetherflowStacks; + + /// + /// Gets the current level of the Fairy Gauge. + /// + [FieldOffset(3)] + public byte FairyGaugeAmount; + + /// + /// Gets the Seraph time remaining in milliseconds. + /// + [FieldOffset(4)] + public short SeraphTimer; + + /// + /// Gets the last dismissed fairy. + /// + [FieldOffset(6)] + public DismissedFairy DismissedFairy; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs index 1742f4d97..a5e9cc219 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs @@ -1,31 +1,54 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory SMN job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct SMNGauge { - - //Unfinished - [FieldOffset(0)] public short TimerRemaining; - [FieldOffset(2)] public SummonPet ReturnSummon; - [FieldOffset(3)] public PetGlam ReturnSummonGlam; - [FieldOffset(4)] public byte NumStacks; + public struct SMNGauge + { + /// + /// Gets the time remaining for the current summon. + /// + [FieldOffset(0)] + public short TimerRemaining; - public bool IsPhoenixReady() { - return (NumStacks & 0x10) > 0; - } + /// + /// Gets the summon that will return after the current summon expires. + /// + [FieldOffset(2)] + public SummonPet ReturnSummon; - public bool IsBahamutReady() { - return (NumStacks & 8) > 0; - } + /// + /// Gets the summon glam for the . + /// + [FieldOffset(3)] + public PetGlam ReturnSummonGlam; - public bool HasAetherflowStacks() { - return (NumStacks & 3) > 0; - } + /// + /// Gets the current stacks. + /// Use the summon accessors instead. + /// + [FieldOffset(4)] + public byte NumStacks; + + /// + /// Gets if Phoenix is ready to be summoned. + /// + /// true or false. + public bool IsPhoenixReady() => (this.NumStacks & 0x10) > 0; + + /// + /// Gets if Bahamut is ready to be summoned. + /// + /// true or false. + public bool IsBahamutReady() => (this.NumStacks & 8) > 0; + + /// + /// Gets if there are any Aetherflow stacks available. + /// + /// true or false. + public bool HasAetherflowStacks() => (this.NumStacks & 3) > 0; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs index ed1ecf364..7747b9cea 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs @@ -1,14 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory WAR job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct WARGauge { - [FieldOffset(0)] public byte BeastGaugeAmount; + public struct WARGauge + { + /// + /// Gets the amount of wrath in the Beast gauge. + /// + [FieldOffset(0)] + public byte BeastGaugeAmount; } } diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs index a5ad15906..0ea51470e 100644 --- a/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs +++ b/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs @@ -1,16 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Dalamud.Game.ClientState.Structs.JobGauge { +namespace Dalamud.Game.ClientState.Structs.JobGauge +{ + /// + /// In-memory WHM job gauge. + /// [StructLayout(LayoutKind.Explicit)] - public struct WHMGauge { - [FieldOffset(2)] public short LilyTimer; //Counts to 30k = 30s - [FieldOffset(4)] public byte NumLilies; - [FieldOffset(5)] public byte NumBloodLily; + public struct WHMGauge + { + /// + /// Gets the time to next lily in milliseconds. + /// + [FieldOffset(2)] + public short LilyTimer; + + /// + /// Gets the number of Lilies. + /// + [FieldOffset(4)] + public byte NumLilies; + + /// + /// Gets the number of times the blood lily has been nourished. + /// + [FieldOffset(5)] + public byte NumBloodLily; } }