-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Showing
14 changed files
with
260 additions
and
89 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
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
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,60 @@ | ||
#pragma once | ||
|
||
#include <il2cpp/il2cpp_helper.h> | ||
|
||
#include "FleetPlayerData.h" | ||
#include "MonoSingleton.h" | ||
|
||
struct ActionQueueManager : MonoSingleton<ActionQueueManager> { | ||
friend struct MonoSingleton<ActionQueueManager>; | ||
|
||
public: | ||
bool IsQueueFull(FleetPlayerData* playerData) | ||
{ | ||
static auto IsQueueFullMethod = | ||
get_class_helper().GetMethod<bool(ActionQueueManager*, FleetPlayerData*)>("IsQueueFull"); | ||
return IsQueueFullMethod(this, playerData); | ||
} | ||
|
||
bool IsFleetInQueue(FleetPlayerData* playerData) | ||
{ | ||
static auto IsFleetInQueueMethod = | ||
get_class_helper().GetMethod<bool(ActionQueueManager*, FleetPlayerData*)>("IsFleetInQueue"); | ||
|
||
return IsFleetInQueueMethod(this, playerData); | ||
} | ||
|
||
bool IsQueueUnlocked() | ||
{ | ||
static auto IsQueueUnlockedMethod = get_class_helper().GetMethod<bool(ActionQueueManager*)>("IsQueueUnlocked"); | ||
return IsQueueUnlockedMethod(this); | ||
} | ||
|
||
bool CanAddToQueue(FleetPlayerData* playerData) | ||
{ | ||
if (IsQueueUnlocked()) { | ||
if (!IsQueueFull(playerData)) { | ||
if (!IsFleetInQueue(playerData)) { | ||
return true; | ||
} | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
void AddToQueue(long targetId) | ||
{ | ||
static auto AddToQueueMethod = get_class_helper().GetMethod<void(ActionQueueManager*, long)>("AddActionToQueue"); | ||
if (AddToQueueMethod != nullptr) { | ||
AddToQueueMethod(this, targetId); | ||
} | ||
} | ||
|
||
private: | ||
static IL2CppClassHelper& get_class_helper() | ||
{ | ||
static auto class_helper = il2cpp_get_class_helper("Assembly-CSharp", "Prime.ActionQueue", "ActionQueueManager"); | ||
return class_helper; | ||
} | ||
}; |
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
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,47 @@ | ||
#pragma once | ||
|
||
#include <il2cpp/il2cpp_helper.h> | ||
#include "HullSpec.h" | ||
|
||
enum class DeployedFleetType { | ||
Nonexistent, | ||
Player, | ||
Marauder, | ||
NpcInstantiated, | ||
Sentinel, | ||
Alliance, | ||
}; | ||
|
||
struct FleetDeployedData { | ||
public: | ||
__declspec(property(get = __get_ID)) long ID; | ||
__declspec(property(get = __get_Hull)) HullSpec* Hull; | ||
__declspec(property(get = __get_FleetType)) DeployedFleetType FleetType; | ||
|
||
private: | ||
static IL2CppClassHelper& get_class_helper() | ||
{ | ||
static auto class_helper = | ||
il2cpp_get_class_helper("Digit.Client.PrimeLib.Runtime", "Digit.PrimeServer.Models", "FleetDeployedData"); | ||
return class_helper; | ||
} | ||
|
||
public: | ||
long __get_ID() | ||
{ | ||
static auto field = get_class_helper().GetProperty("ID"); | ||
return *field.Get<long>(this); | ||
} | ||
|
||
HullSpec* __get_Hull() | ||
{ | ||
static auto field = get_class_helper().GetProperty("Hull"); | ||
return field.GetRaw<HullSpec>(this); | ||
} | ||
|
||
DeployedFleetType __get_FleetType() | ||
{ | ||
static auto field = get_class_helper().GetProperty("FleetType"); | ||
return *field.Get<DeployedFleetType>(this); | ||
} | ||
}; |
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
Oops, something went wrong.