Skip to content

Commit

Permalink
trying to fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
caesarakalaeii committed Aug 17, 2023
1 parent 4d242bd commit 09304a5
Show file tree
Hide file tree
Showing 19 changed files with 1,442 additions and 1,346 deletions.
48 changes: 23 additions & 25 deletions APICommands.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Numerics;
using BattleBitAPI.Common;
using CommunityServerAPI;

namespace BattleBitAPI.Server;
namespace CommunityServerAPI;

public abstract class APICommand
public abstract class ApiCommand
{
public string CommandPrefix;
public string Help;
Expand All @@ -15,7 +13,7 @@ public virtual Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class HealCommand : APICommand
public class HealCommand : ApiCommand
{
public HealCommand()
{
Expand All @@ -40,7 +38,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class KillCommand : APICommand
public class KillCommand : ApiCommand
{
public KillCommand()
{
Expand All @@ -63,7 +61,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class GrenadeCommand : APICommand
public class GrenadeCommand : ApiCommand
{
public string CommandPrefix = "!grenade";

Check warning on line 66 in APICommands.cs

View workflow job for this annotation

GitHub Actions / build

'GrenadeCommand.CommandPrefix' hides inherited member 'ApiCommand.CommandPrefix'. Use the new keyword if hiding was intended.
public string Help = "'steamid': spawns live grenade on specific player";

Check warning on line 67 in APICommands.cs

View workflow job for this annotation

GitHub Actions / build

'GrenadeCommand.Help' hides inherited member 'ApiCommand.Help'. Use the new keyword if hiding was intended.
Expand All @@ -82,7 +80,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class TeleportCommand : APICommand
public class TeleportCommand : ApiCommand
{
public TeleportCommand()
{
Expand Down Expand Up @@ -113,7 +111,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class SpeedCommand : APICommand
public class SpeedCommand : ApiCommand
{
public SpeedCommand()
{
Expand All @@ -135,7 +133,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class ChangeAttachmentCommand : APICommand
public class ChangeAttachmentCommand : ApiCommand
{
public ChangeAttachmentCommand()
{
Expand All @@ -158,7 +156,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class ChangeWeaponCommand : APICommand
public class ChangeWeaponCommand : ApiCommand
{
public ChangeWeaponCommand()
{
Expand All @@ -181,7 +179,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class ForceStartCommand : APICommand
public class ForceStartCommand : ApiCommand
{
public ForceStartCommand()
{
Expand All @@ -201,7 +199,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class HelpCommand : APICommand
public class HelpCommand : ApiCommand
{
public HelpCommand()
{
Expand All @@ -221,7 +219,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class RevealCommand : APICommand
public class RevealCommand : ApiCommand
{
public RevealCommand()
{
Expand All @@ -242,7 +240,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class ChangeDamageCommand : APICommand
public class ChangeDamageCommand : ApiCommand
{
public ChangeDamageCommand()
{
Expand All @@ -264,7 +262,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class ChangeReceivedDamageCommand : APICommand
public class ChangeReceivedDamageCommand : ApiCommand
{
public ChangeReceivedDamageCommand()
{
Expand All @@ -286,7 +284,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class ChangeAmmoCommand : APICommand
public class ChangeAmmoCommand : ApiCommand
{
public ChangeAmmoCommand()
{
Expand All @@ -308,7 +306,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class SetStreamerCommand : APICommand
public class SetStreamerCommand : ApiCommand
{
public SetStreamerCommand()
{
Expand All @@ -329,7 +327,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class RemoveStreamerCommand : APICommand
public class RemoveStreamerCommand : ApiCommand
{
public RemoveStreamerCommand()
{
Expand All @@ -350,7 +348,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class OpCommand : APICommand
public class OpCommand : ApiCommand
{
public OpCommand()
{
Expand All @@ -371,7 +369,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class DeopCommand : APICommand
public class DeopCommand : ApiCommand
{
public DeopCommand()
{
Expand All @@ -392,7 +390,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class NextGameModeCommand : APICommand
public class NextGameModeCommand : ApiCommand
{
public NextGameModeCommand()
{
Expand All @@ -412,7 +410,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class SetGameModeCommand : APICommand
public class SetGameModeCommand : ApiCommand
{
public SetGameModeCommand()
{
Expand All @@ -433,7 +431,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class TogglePlaylistCommand : APICommand
public class TogglePlaylistCommand : ApiCommand
{
public TogglePlaylistCommand()
{
Expand All @@ -454,7 +452,7 @@ public override Command ChatCommand(MyPlayer player, ChatChannel channel, string
}
}

public class GetGameModeCommand : APICommand
public class GetGameModeCommand : ApiCommand
{
public GetGameModeCommand()
{
Expand Down
138 changes: 70 additions & 68 deletions BattleBitAPI/Common/Data/Attachment.cs
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
using BattleBitAPI.Common;
using System;
namespace BattleBitAPI.Common;

namespace BattleBitAPI.Common
public class Attachment : IEquatable<string>, IEquatable<Attachment>

Check warning on line 3 in BattleBitAPI/Common/Data/Attachment.cs

View workflow job for this annotation

GitHub Actions / build

'Attachment' defines operator == or operator != but does not override Object.Equals(object o)

Check warning on line 3 in BattleBitAPI/Common/Data/Attachment.cs

View workflow job for this annotation

GitHub Actions / build

'Attachment' defines operator == or operator != but does not override Object.GetHashCode()
{
public class Attachment : IEquatable<string>, IEquatable<Attachment>
public Attachment(string name, AttachmentType attachmentType)
{
public string Name { get; private set; }
public AttachmentType AttachmentType { get; private set; }
public Attachment(string name, AttachmentType attachmentType)
{
Name = name;
AttachmentType = attachmentType;
}
Name = name;
AttachmentType = attachmentType;
}

public string Name { get; }
public AttachmentType AttachmentType { get; private set; }

public bool Equals(Attachment other)
{
if (other == null)
return false;
return Name.Equals(other.Name);
}

public bool Equals(string other)
{
if (other == null)
return false;
return Name.Equals(other);
}

public override string ToString()
{
return Name;
}

public static bool operator ==(string left, Attachment right)
{
var leftNull = ReferenceEquals(left, null);
var rightNull = ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}

public static bool operator !=(string left, Attachment right)
{
var leftNull = ReferenceEquals(left, null);
var rightNull = ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}

public override string ToString()
{
return this.Name;
}
public bool Equals(string other)
{
if (other == null)
return false;
return this.Name.Equals(other);
}
public bool Equals(Attachment other)
{
if (other == null)
return false;
return this.Name.Equals(other.Name);
}
public static bool operator ==(Attachment right, string left)
{
var leftNull = ReferenceEquals(left, null);
var rightNull = ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}

public static bool operator ==(string left, Attachment right)
{
bool leftNull = object.ReferenceEquals(left, null);
bool rightNull = object.ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}
public static bool operator !=(string left, Attachment right)
{
bool leftNull = object.ReferenceEquals(left, null);
bool rightNull = object.ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}
public static bool operator ==(Attachment right, string left)
{
bool leftNull = object.ReferenceEquals(left, null);
bool rightNull = object.ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}
public static bool operator !=(Attachment right, string left)
{
bool leftNull = object.ReferenceEquals(left, null);
bool rightNull = object.ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}
public static bool operator !=(Attachment right, string left)
{
var leftNull = ReferenceEquals(left, null);
var rightNull = ReferenceEquals(right, null);
if (leftNull && rightNull)
return true;
if (leftNull || rightNull)
return false;
return right.Name.Equals(left);
}
}
}
Loading

0 comments on commit 09304a5

Please sign in to comment.