Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions S1API/Console/ConsoleHelper.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System.Collections.Generic;

#if IL2CPPMELON || IL2CPPBEPINEX
#if IL2CPP
using Il2CppSystem.Collections.Generic;
using static Il2CppScheduleOne.Console;

#else
using static ScheduleOne.Console;
using System.Collections.Generic;
#endif

namespace S1API.Utils
namespace S1API.Console
{
/// <summary>
/// This class provides easy access to the in-game console system.
/// </summary>
public static class ConsoleHelper
{
/// <summary>
Expand All @@ -19,7 +20,7 @@ public static class ConsoleHelper
/// <param name="amount">The cash amount to add or remove.</param>
public static void RunCashCommand(int amount)
{
#if IL2CPPMELON || IL2CPPBEPINEX
#if IL2CPP
var command = new ChangeCashCommand();
var args = new Il2CppSystem.Collections.Generic.List<string>();
#else
Expand All @@ -30,4 +31,4 @@ public static void RunCashCommand(int amount)
command.Execute(args);
}
}
}
}
25 changes: 25 additions & 0 deletions S1API/Entities/Interfaces/IEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using UnityEngine;

namespace S1API.Entities.Interfaces
{
/// <summary>
/// Represents an entity within the game world.
/// </summary>
public interface IEntity
{
/// <summary>
/// INTERNAL: Tracking of the GameObject associated with this entity.
/// </summary>
GameObject gameObject { get; }

/// <summary>
/// The world position of the entity.
/// </summary>
public Vector3 Position { get; set; }

/// <summary>
/// The scale of the entity.
/// </summary>
public float Scale { get; set; }
}
}
57 changes: 57 additions & 0 deletions S1API/Entities/Interfaces/IHealth.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;

namespace S1API.Entities.Interfaces
{
/// <summary>
/// Represents an entity that has health associated.
/// </summary>
public interface IHealth
{
/// <summary>
/// The current health of the entity.
/// </summary>
public float CurrentHealth { get; }

/// <summary>
/// The max health of the entity.
/// </summary>
public float MaxHealth { get; set; }

/// <summary>
/// Whether the entity is dead or not.
/// </summary>
public bool IsDead { get; }

/// <summary>
/// Whether the entity is invincible.
/// </summary>
public bool IsInvincible { get; set; }

/// <summary>
/// Revives the entity.
/// </summary>
public void Revive();

/// <summary>
/// Deals damage to the entity.
/// </summary>
/// <param name="amount">Amount of damage to deal.</param>
public void Damage(int amount);

/// <summary>
/// Heals the entity.
/// </summary>
/// <param name="amount">Amount of health to heal.</param>
public void Heal(int amount);

/// <summary>
/// Kills the entity.
/// </summary>
public void Kill();

/// <summary>
/// Called when entity's health is less than or equal to 0.
/// </summary>
public event Action OnDeath;
}
}
Loading
Loading