StyleCop: JobGauges

This commit is contained in:
Raymond Lynch 2021-05-29 21:12:51 -04:00
parent 97d8fa855a
commit 1f701ec165
21 changed files with 796 additions and 294 deletions

View file

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Target">
<PlatformTarget>AnyCPU</PlatformTarget>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup Label="Build">

View file

@ -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<T>() {
return Marshal.PtrToStructure<T>(Address.JobGaugeData);
}
}
}

View file

@ -0,0 +1,35 @@
using System.Runtime.InteropServices;
using Serilog;
namespace Dalamud.Game.ClientState
{
/// <summary>
/// This class converts in-memory Job gauge data to structs.
/// </summary>
public class JobGauges
{
/// <summary>
/// Initializes a new instance of the <see cref="JobGauges"/> class.
/// </summary>
/// <param name="addressResolver">Address resolver with the JobGauge memory location(s).</param>
public JobGauges(ClientStateAddressResolver addressResolver)
{
this.Address = addressResolver;
Log.Verbose("JobGaugeData address {JobGaugeData}", this.Address.JobGaugeData);
}
private ClientStateAddressResolver Address { get; }
/// <summary>
/// Get the JobGauge for a given job.
/// </summary>
/// <typeparam name="T">A JobGauge struct from ClientState.Structs.JobGauge.</typeparam>
/// <returns>A JobGauge.</returns>
public T Get<T>()
{
return Marshal.PtrToStructure<T>(this.Address.JobGaugeData);
}
}
}

View file

@ -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
{
/// <summary>
/// In-memory AST job gauge.
/// </summary>
[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;
/// <summary>
/// Gets the currently drawn <see cref="CardType"/>.
/// </summary>
/// <returns>Currently drawn <see cref="CardType"/>.</returns>
public CardType DrawnCard() => this.card;
/// <summary>
/// Check if a <see cref="SealType"/> is currently active on the divination gauge.
/// </summary>
/// <param name="seal">The <see cref="SealType"/> to check for.</param>
/// <returns>If the given Seal is currently divined.</returns>
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;
}
}

View file

@ -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
{
/// <summary>
/// In-memory BLM job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the time until the next Polyglot stack in milliseconds.
/// </summary>
[FieldOffset(0)]
public short TimeUntilNextPolyglot; // enochian timer
public bool InUmbralIce() {
return ElementStance > 4;
}
/// <summary>
/// Gets the time remaining for Astral Fire or Umbral Ice in milliseconds.
/// </summary>
[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;
}
/// <summary>
/// Gets the number of Umbral Hearts remaining.
/// </summary>
[FieldOffset(5)]
public byte NumUmbralHearts;
/// <summary>
/// Gets the number of Polyglot stacks remaining.
/// </summary>
[FieldOffset(6)]
public byte NumPolyglotStacks;
[FieldOffset(7)]
private byte enochianState;
/// <summary>
/// Gets if the player is in Umbral Ice.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool InUmbralIce() => this.elementStance > 4;
/// <summary>
/// Gets if the player is in Astral fire.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool InAstralFire() => this.elementStance > 0 && this.elementStance < 4;
/// <summary>
/// Gets if Enochian is active.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsEnoActive() => this.enochianState > 0;
}
}

View file

@ -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
{
/// <summary>
/// In-memory BRD job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the current song timer in milliseconds.
/// </summary>
[FieldOffset(0)]
public short SongTimer;
/// <summary>
/// Gets the number of stacks for the current song.
/// </summary>
[FieldOffset(2)]
public byte NumSongStacks;
/// <summary>
/// Gets the amount of Soul Voice accumulated.
/// </summary>
[FieldOffset(3)]
public byte SoulVoiceValue;
/// <summary>
/// Gets the type of song that is active.
/// </summary>
[FieldOffset(4)]
public CurrentSong ActiveSong;
}
}

View file

@ -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
{
/// <summary>
/// In-memory DNC job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the number of feathers available.
/// </summary>
[FieldOffset(0)]
public byte NumFeathers;
public bool IsDancing() {
return StepOrder[0] != 0;
}
/// <summary>
/// Gets the amount of Espirit available.
/// </summary>
[FieldOffset(1)]
public byte Esprit;
public ulong NextStep() {
return (ulong)(15999 + StepOrder[NumCompleteSteps] - 1);
}
[FieldOffset(2)]
private fixed byte stepOrder[4];
/// <summary>
/// Gets the number of steps completed for the current dance.
/// </summary>
[FieldOffset(6)]
public byte NumCompleteSteps;
/// <summary>
/// Gets the next step in the current dance.
/// </summary>
public ulong NextStep => (ulong)(15999 + this.stepOrder[this.NumCompleteSteps] - 1);
/// <summary>
/// Gets if the player is dancing or not.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsDancing() => this.stepOrder[0] != 0;
}
}

View file

@ -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
{
/// <summary>
/// In-memory DRG job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct DRGGauge {
[FieldOffset(0)] public short BOTDTimer;
[FieldOffset(2)] public BOTDState BOTDState;
[FieldOffset(3)] public byte EyeCount;
public struct DRGGauge
{
/// <summary>
/// Gets the time remaining for Blood of the Dragon in milliseconds.
/// </summary>
[FieldOffset(0)]
public short BOTDTimer;
/// <summary>
/// Gets the current state of Blood of the Dragon.
/// </summary>
[FieldOffset(2)]
public BOTDState BOTDState;
/// <summary>
/// Gets the count of eyes opened during Blood of the Dragon.
/// </summary>
[FieldOffset(3)]
public byte EyeCount;
}
}

View file

@ -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
{
/// <summary>
/// In-memory DRK job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the amount of blood accumulated.
/// </summary>
[FieldOffset(0)]
public byte Blood;
public bool HasDarkArts() {
return DarkArtsState > 0;
}
/// <summary>
/// Gets the Darkside time remaining in milliseconds.
/// </summary>
[FieldOffset(2)]
public ushort DarksideTimeRemaining;
[FieldOffset(4)]
private byte darkArtsState;
/// <summary>
/// Gets the Shadow time remaining in milliseconds.
/// </summary>
[FieldOffset(6)]
public ushort ShadowTimeRemaining;
/// <summary>
/// Gets if the player has Dark Arts or not.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool HasDarkArts() => this.darkArtsState > 0;
}
}

View file

@ -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
{
/// <summary>
/// In-memory GNB job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct GNBGauge {
[FieldOffset(0)] public byte NumAmmo;
[FieldOffset(2)] public short MaxTimerDuration;
[FieldOffset(4)] public byte AmmoComboStepNumber;
public struct GNBGauge
{
/// <summary>
/// Gets the amount of ammo available.
/// </summary>
[FieldOffset(0)]
public byte NumAmmo;
/// <summary>
/// Gets the max combo time of the Gnashing Fang combo.
/// </summary>
[FieldOffset(2)]
public short MaxTimerDuration;
/// <summary>
/// Gets the current step of the Gnashing Fang combo.
/// </summary>
[FieldOffset(4)]
public byte AmmoComboStepNumber;
}
}

View file

@ -1,67 +1,272 @@
using System;
namespace Dalamud.Game.ClientState.Structs.JobGauge {
public enum SealType : byte {
namespace Dalamud.Game.ClientState.Structs.JobGauge
{
#region AST
/// <summary>
/// AST Divination seal types.
/// </summary>
public enum SealType : byte
{
/// <summary>
/// No seal.
/// </summary>
NONE = 0,
SUN,
MOON,
CELESTIAL
/// <summary>
/// Sun seal.
/// </summary>
SUN = 1,
/// <summary>
/// Moon seal.
/// </summary>
MOON = 2,
/// <summary>
/// Celestial seal.
/// </summary>
CELESTIAL = 3,
}
public enum CardType : byte {
/// <summary>
/// AST Arcanum (card) types.
/// </summary>
public enum CardType : byte
{
/// <summary>
/// No card.
/// </summary>
NONE = 0,
BALANCE,
BOLE,
ARROW,
SPEAR,
EWER,
SPIRE,
/// <summary>
/// The Balance card.
/// </summary>
BALANCE = 1,
/// <summary>
/// The Bole card.
/// </summary>
BOLE = 2,
/// <summary>
/// The Arrow card.
/// </summary>
ARROW = 3,
/// <summary>
/// The Spear card.
/// </summary>
SPEAR = 4,
/// <summary>
/// The Ewer card.
/// </summary>
EWER = 5,
/// <summary>
/// The Spire card.
/// </summary>
SPIRE = 6,
/// <summary>
/// The Lord of Crowns card.
/// </summary>
LORD = 0x70,
LADY = 0x80
/// <summary>
/// The Lady of Crowns card.
/// </summary>
LADY = 0x80,
}
public enum SummonPet : byte {
#endregion
#region BRD
/// <summary>
/// BRD Current Song types.
/// </summary>
public enum CurrentSong : byte
{
/// <summary>
/// No song is active type.
/// </summary>
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 {
/// <summary>
/// Mage's Ballad type.
/// </summary>
MAGE = 5,
/// <summary>
/// Army's Paeon type.
/// </summary>
ARMY = 0xA,
WANDERER = 0xF
/// <summary>
/// The Wanderer's Minuet type.
/// </summary>
WANDERER = 0xF,
}
public enum DismissedFairy : byte {
EOS = 6,
SELENE
#endregion
#region DRG
/// <summary>
/// DRG Blood of the Dragon state types.
/// </summary>
public enum BOTDState : byte
{
/// <summary>
/// Inactive type.
/// </summary>
NONE = 0,
/// <summary>
/// Blood of the Dragon is active.
/// </summary>
BOTD = 1,
/// <summary>
/// Life of the Dragon is active.
/// </summary>
LOTD = 2,
}
public enum Mudras : byte {
#endregion
#region NIN
/// <summary>
/// NIN Mudra types.
/// </summary>
public enum Mudras : byte
{
/// <summary>
/// Ten mudra.
/// </summary>
TEN = 1,
/// <summary>
/// Chi mudra.
/// </summary>
CHI = 2,
JIN = 3
/// <summary>
/// Jin mudra.
/// </summary>
JIN = 3,
}
#endregion
#region SAM
/// <summary>
/// Samurai Sen types.
/// </summary>
[Flags]
public enum Sen : byte
{
/// <summary>
/// No Sen.
/// </summary>
NONE = 0,
/// <summary>
/// Setsu Sen type.
/// </summary>
SETSU = 1 << 0,
/// <summary>
/// Getsu Sen type.
/// </summary>
GETSU = 1 << 1,
/// <summary>
/// Ka Sen type.
/// </summary>
KA = 1 << 2,
}
#endregion
#region SCH
/// <summary>
/// SCH Dismissed fairy types.
/// </summary>
public enum DismissedFairy : byte
{
/// <summary>
/// Dismissed fairy is Eos.
/// </summary>
EOS = 6,
/// <summary>
/// Dismissed fairy is Selene.
/// </summary>
SELENE = 7,
}
#endregion
#region SMN
/// <summary>
/// SMN summoned pet types.
/// </summary>
public enum SummonPet : byte
{
/// <summary>
/// No pet.
/// </summary>
NONE = 0,
/// <summary>
/// The summoned pet Ifrit.
/// </summary>
IFRIT = 3,
/// <summary>
/// The summoned pet Titan.
/// </summary>
TITAN = 4,
/// <summary>
/// The summoned pet Garuda.
/// </summary>
GARUDA = 5,
}
/// <summary>
/// SMN summoned pet glam types.
/// </summary>
public enum PetGlam : byte
{
/// <summary>
/// No pet glam.
/// </summary>
NONE = 0,
/// <summary>
/// Emerald carbuncle pet glam.
/// </summary>
EMERALD = 1,
/// <summary>
/// Topaz carbuncle pet glam.
/// </summary>
TOPAZ = 2,
/// <summary>
/// Ruby carbuncle pet glam.
/// </summary>
RUBY = 3,
}
#endregion
}

View file

@ -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
{
/// <summary>
/// In-memory MCH job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct MCHGauge{
public struct MCHGauge
{
/// <summary>
/// Gets the time time remaining for Overheat in milliseconds.
/// </summary>
[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;
/// <summary>
/// Gets the time remaining for the Rook or Queen in milliseconds.
/// </summary>
[FieldOffset(2)]
public short RobotTimeRemaining;
public bool IsOverheated() {
return (TimerActive & 1) != 0;
}
public bool IsRobotActive() {
return (TimerActive & 2) != 0;
}
/// <summary>
/// Gets the current Heat level.
/// </summary>
[FieldOffset(4)]
public byte Heat;
/// <summary>
/// Gets the current Battery level.
/// </summary>
[FieldOffset(5)]
public byte Battery;
/// <summary>
/// Gets the battery level of the last Robot.
/// </summary>
[FieldOffset(6)]
public byte LastRobotBatteryPower;
[FieldOffset(7)]
private byte timerActive;
/// <summary>
/// Gets if the player is currently Overheated.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsOverheated() => (this.timerActive & 1) != 0;
/// <summary>
/// Gets if the player has an active Robot.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsRobotActive() => (this.timerActive & 2) != 0;
}
}

View file

@ -3,20 +3,40 @@ using System.Runtime.InteropServices;
namespace Dalamud.Game.ClientState.Structs.JobGauge
{
/// <summary>
/// In-memory MNK job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct MNKGauge
{
[FieldOffset(0)] public byte NumChakra;
/// <summary>
/// Gets the number of Chakra available.
/// </summary>
[FieldOffset(0)]
public byte NumChakra;
/// <summary>
/// Gets the Greased Lightning timer in milliseconds.
/// </summary>
[Obsolete("GL has been removed from the game")]
[FieldOffset(0)]
public byte GLTimer;
/// <summary>
/// Gets the amount of Greased Lightning stacks.
/// </summary>
[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;
/// <summary>
/// Gets if the Greased Lightning timer has been frozen.
/// </summary>
/// <returns>><c>true</c> or <c>false</c>.</returns>
[Obsolete("GL has been removed from the game")]
public bool IsGLTimerFroze() => false;
}

View file

@ -3,16 +3,36 @@ using System.Runtime.InteropServices;
namespace Dalamud.Game.ClientState.Structs.JobGauge
{
/// <summary>
/// In-memory NIN job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct NINGauge
{
[FieldOffset(0)] public int HutonTimeLeft;
[FieldOffset(4)] public byte Ninki;
/// <summary>
/// Gets the time left on Huton in milliseconds.
/// </summary>
// TODO: Probably a short, confirm.
[FieldOffset(0)]
public int HutonTimeLeft;
[Obsolete("Does not appear to be used")]
[FieldOffset(4)] public byte TCJMudrasUsed;
/// <summary>
/// Gets the amount of Ninki available.
/// </summary>
[FieldOffset(4)]
public byte Ninki;
/// <summary>
/// Obsolete.
/// </summary>
[Obsolete("Does not appear to be used")]
[FieldOffset(6)] public byte NumHutonManualCasts;
[FieldOffset(4)]
public byte TCJMudrasUsed;
/// <summary>
/// Gets the number of times Huton has been cast manually.
/// </summary>
[FieldOffset(5)]
public byte NumHutonManualCasts;
}
}

View file

@ -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
{
/// <summary>
/// In-memory PLD job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct PLDGauge {
[FieldOffset(0)] public byte GaugeAmount;
public struct PLDGauge
{
/// <summary>
/// Gets the current level of the Oath gauge.
/// </summary>
[FieldOffset(0)]
public byte GaugeAmount;
}
}

View file

@ -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
{
/// <summary>
/// In-memory RDM job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct RDMGauge {
[FieldOffset(0)] public byte WhiteGauge;
[FieldOffset(1)] public byte BlackGauge;
public struct RDMGauge
{
/// <summary>
/// Gets the level of the White gauge.
/// </summary>
[FieldOffset(0)]
public byte WhiteGauge;
/// <summary>
/// Gets the level of the Black gauge.
/// </summary>
[FieldOffset(1)]
public byte BlackGauge;
}
}

View file

@ -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
{
/// <summary>
/// In-memory SAM job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct SAMGauge {
public struct SAMGauge
{
/// <summary>
/// Gets the current amount of Kenki available.
/// </summary>
[FieldOffset(3)]
public byte Kenki;
[FieldOffset(3)] public byte Kenki;
[FieldOffset(4)] public byte MeditationStacks;
[FieldOffset(5)] public Sen Sen;
/// <summary>
/// Gets the amount of Meditation stacks.
/// </summary>
[FieldOffset(4)]
public byte MeditationStacks;
/// <summary>
/// Gets the active Sen.
/// </summary>
[FieldOffset(5)]
public Sen Sen;
/// <summary>
/// Gets if the Setsu Sen is active.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool HasSetsu() => (this.Sen & Sen.SETSU) != 0;
/// <summary>
/// Gets if the Getsu Sen is active.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool HasGetsu() => (this.Sen & Sen.GETSU) != 0;
/// <summary>
/// Gets if the Ka Sen is active.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool HasKa() => (this.Sen & Sen.KA) != 0;
}
}

View file

@ -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
{
/// <summary>
/// In-memory SCH job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the amount of Aetherflow stacks available.
/// </summary>
[FieldOffset(2)]
public byte NumAetherflowStacks;
/// <summary>
/// Gets the current level of the Fairy Gauge.
/// </summary>
[FieldOffset(3)]
public byte FairyGaugeAmount;
/// <summary>
/// Gets the Seraph time remaining in milliseconds.
/// </summary>
[FieldOffset(4)]
public short SeraphTimer;
/// <summary>
/// Gets the last dismissed fairy.
/// </summary>
[FieldOffset(6)]
public DismissedFairy DismissedFairy;
}
}

View file

@ -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
{
/// <summary>
/// In-memory SMN job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the time remaining for the current summon.
/// </summary>
[FieldOffset(0)]
public short TimerRemaining;
public bool IsPhoenixReady() {
return (NumStacks & 0x10) > 0;
}
/// <summary>
/// Gets the summon that will return after the current summon expires.
/// </summary>
[FieldOffset(2)]
public SummonPet ReturnSummon;
public bool IsBahamutReady() {
return (NumStacks & 8) > 0;
}
/// <summary>
/// Gets the summon glam for the <see cref="ReturnSummon"/>.
/// </summary>
[FieldOffset(3)]
public PetGlam ReturnSummonGlam;
public bool HasAetherflowStacks() {
return (NumStacks & 3) > 0;
}
/// <summary>
/// Gets the current stacks.
/// Use the summon accessors instead.
/// </summary>
[FieldOffset(4)]
public byte NumStacks;
/// <summary>
/// Gets if Phoenix is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsPhoenixReady() => (this.NumStacks & 0x10) > 0;
/// <summary>
/// Gets if Bahamut is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsBahamutReady() => (this.NumStacks & 8) > 0;
/// <summary>
/// Gets if there are any Aetherflow stacks available.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool HasAetherflowStacks() => (this.NumStacks & 3) > 0;
}
}

View file

@ -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
{
/// <summary>
/// In-memory WAR job gauge.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public struct WARGauge {
[FieldOffset(0)] public byte BeastGaugeAmount;
public struct WARGauge
{
/// <summary>
/// Gets the amount of wrath in the Beast gauge.
/// </summary>
[FieldOffset(0)]
public byte BeastGaugeAmount;
}
}

View file

@ -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
{
/// <summary>
/// In-memory WHM job gauge.
/// </summary>
[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
{
/// <summary>
/// Gets the time to next lily in milliseconds.
/// </summary>
[FieldOffset(2)]
public short LilyTimer;
/// <summary>
/// Gets the number of Lilies.
/// </summary>
[FieldOffset(4)]
public byte NumLilies;
/// <summary>
/// Gets the number of times the blood lily has been nourished.
/// </summary>
[FieldOffset(5)]
public byte NumBloodLily;
}
}