refactor: use nullable annotations instead of CanBeNullAttribute

This commit is contained in:
goat 2021-08-22 23:06:46 +02:00
parent 3c5c7fbc80
commit 010a4972cd
No known key found for this signature in database
GPG key ID: F18F057873895461
14 changed files with 33 additions and 62 deletions

View file

@ -72,8 +72,7 @@ namespace Dalamud.Game.ClientState.Party
/// </summary>
/// <param name="index">Spawn index.</param>
/// <returns>A <see cref="PartyMember"/> at the specified spawn index.</returns>
[CanBeNull]
public PartyMember this[int index]
public PartyMember? this[int index]
{
get
{
@ -112,8 +111,7 @@ namespace Dalamud.Game.ClientState.Party
/// </summary>
/// <param name="address">The address of the party member in memory.</param>
/// <returns>The party member object containing the requested data.</returns>
[CanBeNull]
public PartyMember CreatePartyMemberReference(IntPtr address)
public PartyMember? CreatePartyMemberReference(IntPtr address)
{
var clientState = Service<ClientState>.Get();
@ -144,8 +142,7 @@ namespace Dalamud.Game.ClientState.Party
/// </summary>
/// <param name="address">The address of the alliance member in memory.</param>
/// <returns>The party member object containing the requested data.</returns>
[CanBeNull]
public PartyMember CreateAllianceMemberReference(IntPtr address)
public PartyMember? CreateAllianceMemberReference(IntPtr address)
{
var clientState = Service<ClientState>.Get();

View file

@ -56,8 +56,7 @@ namespace Dalamud.Game.ClientState.Party
/// <remarks>
/// This iterates the actor table, it should be used with care.
/// </remarks>
[CanBeNull]
public GameObject GameObject => Service<ObjectTable>.Get().SearchByID(this.ObjectId);
public GameObject? GameObject => Service<ObjectTable>.Get().SearchByID(this.ObjectId);
/// <summary>
/// Gets the current HP of this party member.