-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf480b1
commit 8caebc1
Showing
109 changed files
with
6,499 additions
and
5,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
using Randomizer.Data.Options; | ||
using Randomizer.Data.Tracking; | ||
using Randomizer.Shared.Enums; | ||
|
||
namespace Randomizer.Abstractions; | ||
|
||
public interface IAutoTracker | ||
{ | ||
/// <summary> | ||
/// The tracker associated with this auto tracker | ||
/// </summary> | ||
public ITracker Tracker { get; } | ||
|
||
/// <summary> | ||
/// The type of connector that the auto tracker is currently using | ||
/// </summary> | ||
public EmulatorConnectorType ConnectorType { get; } | ||
|
||
/// <summary> | ||
/// The game that the player is currently in | ||
/// </summary> | ||
public Game CurrentGame { get; } | ||
|
||
/// <summary> | ||
/// The latest state that the player in LTTP (location, health, etc.) | ||
/// </summary> | ||
public AutoTrackerZeldaState? ZeldaState { get; } | ||
|
||
/// <summary> | ||
/// The latest state that the player in Super Metroid (location, health, etc.) | ||
/// </summary> | ||
public AutoTrackerMetroidState? MetroidState { get; } | ||
|
||
/// <summary> | ||
/// Disables the current connector and creates the requested type | ||
/// </summary> | ||
public void SetConnector(EmulatorConnectorType type, string? qusb2SnesIp); | ||
|
||
/// <summary> | ||
/// Occurs when the tracker's auto tracker is enabled | ||
/// </summary> | ||
public event EventHandler? AutoTrackerEnabled; | ||
|
||
/// <summary> | ||
/// Occurs when the tracker's auto tracker is disabled | ||
/// </summary> | ||
public event EventHandler? AutoTrackerDisabled; | ||
|
||
/// <summary> | ||
/// Occurs when the tracker's auto tracker is connected | ||
/// </summary> | ||
public event EventHandler? AutoTrackerConnected; | ||
|
||
/// <summary> | ||
/// Occurs when the tracker's auto tracker is disconnected | ||
/// </summary> | ||
public event EventHandler? AutoTrackerDisconnected; | ||
|
||
/// <summary> | ||
/// The action to run when the player asks Tracker to look at the game | ||
/// </summary> | ||
public AutoTrackerViewedAction? LatestViewAction { get; set; } | ||
|
||
/// <summary> | ||
/// If a connector is currently enabled | ||
/// </summary> | ||
public bool IsEnabled { get; } | ||
|
||
/// <summary> | ||
/// If a connector is currently connected to the emulator | ||
/// </summary> | ||
public bool IsConnected { get; } | ||
|
||
/// <summary> | ||
/// If a connector is currently connected to the emulator and a valid game state is detected | ||
/// </summary> | ||
public bool HasValidState { get; } | ||
|
||
/// <summary> | ||
/// If the auto tracker is currently sending messages | ||
/// </summary> | ||
public bool IsSendingMessages { get; } | ||
|
||
/// <summary> | ||
/// If the player currently has a fairy | ||
/// </summary> | ||
public bool PlayerHasFairy { get; } | ||
|
||
/// <summary> | ||
/// If the user is activately in an SMZ3 rom | ||
/// </summary> | ||
public bool IsInSMZ3 { get; } | ||
|
||
/// <summary> | ||
/// Writes a particular action to the emulator memory | ||
/// </summary> | ||
/// <param name="action">The action to write to memory</param> | ||
public void WriteToMemory(EmulatorAction action); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
using Randomizer.Data.Tracking; | ||
using Randomizer.Data.WorldData; | ||
using Randomizer.Shared; | ||
|
||
namespace Randomizer.Abstractions; | ||
|
||
public interface IGameService | ||
{ | ||
/// <summary> | ||
/// Updates memory values so both SM and Z3 will cancel any pending MSU resumes and play | ||
/// all tracks from the start until new resume points have been stored. | ||
/// </summary> | ||
/// <returns>True, even if it didn't do anything</returns> | ||
public void TryCancelMsuResume(); | ||
|
||
/// <summary> | ||
/// Gives an item to the player | ||
/// </summary> | ||
/// <param name="item">The item to give</param> | ||
/// <param name="fromPlayerId">The id of the player giving the item to the player (null for tracker)</param> | ||
/// <returns>False if it is currently unable to give an item to the player</returns> | ||
public bool TryGiveItem(Item item, int? fromPlayerId); | ||
|
||
/// <summary> | ||
/// Gives a series of items to the player | ||
/// </summary> | ||
/// <param name="items">The list of items to give to the player</param> | ||
/// <param name="fromPlayerId">The id of the player giving the item to the player</param> | ||
/// <returns>False if it is currently unable to give an item to the player</returns> | ||
public bool TryGiveItems(List<Item> items, int fromPlayerId); | ||
|
||
/// <summary> | ||
/// Gives a series of item types from particular players | ||
/// </summary> | ||
/// <param name="items">The list of item types and the players that are giving the item to the player</param> | ||
/// <returns>False if it is currently unable to give the items to the player</returns> | ||
public bool TryGiveItemTypes(List<(ItemType type, int fromPlayerId)> items); | ||
|
||
/// <summary> | ||
/// Restores the player to max health | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give an item to the player</returns> | ||
public bool TryHealPlayer(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's magic | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give magic to the player</returns> | ||
public bool TryFillMagic(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's bombs to capacity | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give bombs to the player</returns> | ||
public bool TryFillZeldaBombs(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's arrows | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give arrows to the player</returns> | ||
public bool TryFillArrows(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's rupees (sets to 2000) | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give rupees to the player</returns> | ||
public bool TryFillRupees(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's missiles | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give missiles to the player</returns> | ||
public bool TryFillMissiles(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's super missiles | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give super missiles to the player</returns> | ||
public bool TryFillSuperMissiles(); | ||
|
||
/// <summary> | ||
/// Fully fills the player's power bombs | ||
/// </summary> | ||
/// <returns>False if it is currently unable to give power bombs to the player</returns> | ||
public bool TryFillPowerBombs(); | ||
|
||
/// <summary> | ||
/// Kills the player by removing their health and dealing damage to them | ||
/// </summary> | ||
/// <returns>True if successful</returns> | ||
public bool TryKillPlayer(); | ||
|
||
/// <summary> | ||
/// Sets the player to have the requirements for a crystal flash | ||
/// </summary> | ||
/// <returns>True if successful</returns> | ||
public bool TrySetupCrystalFlash(); | ||
|
||
/// <summary> | ||
/// Gives the player any items that tracker thinks they should have but are not in memory as having been gifted | ||
/// </summary> | ||
/// <param name="action"></param> | ||
public void SyncItems(EmulatorAction action); | ||
|
||
/// <summary> | ||
/// If the player was recently killed by the game service | ||
/// </summary> | ||
public bool PlayerRecentlyKilled { get; } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Randomizer.Data.WorldData; | ||
using Randomizer.Shared.Enums; | ||
using Randomizer.Shared.Models; | ||
|
||
namespace Randomizer.Abstractions; | ||
|
||
/// <summary> | ||
/// Service for managing the history of events through a playthrough | ||
/// </summary> | ||
public interface IHistoryService | ||
{ | ||
/// <summary> | ||
/// Adds an event to the history log | ||
/// </summary> | ||
/// <param name="type">The type of event</param> | ||
/// <param name="isImportant">If this is an important event or not</param> | ||
/// <param name="objectName">The name of the event being logged</param> | ||
/// <param name="location">The optional location of where this event happened</param> | ||
/// <returns>The created event</returns> | ||
public TrackerHistoryEvent AddEvent(HistoryEventType type, bool isImportant, string objectName, Location? location = null); | ||
|
||
/// <summary> | ||
/// Adds an event to the history log | ||
/// </summary> | ||
/// <param name="histEvent">The event to add</param> | ||
public void AddEvent(TrackerHistoryEvent histEvent); | ||
|
||
/// <summary> | ||
/// Removes the event that was added last to the log | ||
/// </summary> | ||
public void RemoveLastEvent(); | ||
|
||
/// <summary> | ||
/// Removes a specific event from the log | ||
/// </summary> | ||
/// <param name="histEvent">The event to log</param> | ||
public void Remove(TrackerHistoryEvent histEvent); | ||
|
||
/// <summary> | ||
/// Retrieves the current history log | ||
/// </summary> | ||
/// <returns>The collection of events</returns> | ||
public IReadOnlyCollection<TrackerHistoryEvent> GetHistory(); | ||
} |
Oops, something went wrong.