Skip to content

Commit

Permalink
Refactor properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jan 9, 2025
1 parent 3f0dc31 commit c10640a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
36 changes: 19 additions & 17 deletions Fika.Core/Coop/GameMode/CoopGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,22 @@ namespace Fika.Core.Coop.GameMode
/// </summary>
public sealed class CoopGame : BaseLocalGame<EftGamePlayerOwner>, IBotGame, IFikaGame
{
public string InfiltrationPoint;
public string InfiltrationPoint { get; internal set; }
public ExitStatus ExitStatus { get; set; } = ExitStatus.Survived;
public string ExitLocation { get; set; }
public ISpawnSystem SpawnSystem;
public ISpawnSystem SpawnSystem { get; internal set; }
public Dictionary<string, Player> Bots = [];
public List<int> ExtractedPlayers { get; } = [];
public string SpawnId;
public bool InteractablesInitialized { get; set; }
public bool HasReceivedLoot { get; set; }
public List<ThrowWeapItemClass> ThrownGrenades;
public string SpawnId { get; internal set; }
public bool InteractablesInitialized { get; internal set; }
public bool HasReceivedLoot { get; internal set; }
public List<ThrowWeapItemClass> ThrownGrenades { get; internal set; }
public bool WeatherReady { get; internal set; }
public bool RaidStarted { get; set; }
public bool RaidStarted { get; internal set; }
public FikaDynamicAI DynamicAI { get; private set; }
public RaidSettings RaidSettings { get; private set; }
public byte[] HostLootItems { get; private set; }
public GClass1315 LootItems { get; internal set; } = [];

private readonly Dictionary<int, int> botQueue = [];
private Coroutine extractRoutine;
Expand All @@ -85,11 +89,7 @@ public sealed class CoopGame : BaseLocalGame<EftGamePlayerOwner>, IBotGame, IFik
private TimeSpan? sessionTime;
private BotStateManager botStateManager;
private ESeason season;

public FikaDynamicAI DynamicAI { get; private set; }
public RaidSettings RaidSettings { get; private set; }
public byte[] HostLootItems { get; private set; }
public GClass1315 LootItems { get; internal set; } = [];

BossSpawnScenario IBotGame.BossSpawnScenario
{
get
Expand Down Expand Up @@ -131,6 +131,7 @@ public ESeason Season
{
season = value;
Logger.LogInfo($"Setting Season to: {value}");
WeatherReady = true;
}
}

Expand Down Expand Up @@ -1606,8 +1607,7 @@ private async Task GenerateWeathers()
if (Location_0.Id == "laboratory")
{
Logger.LogInfo("Location is 'Laboratory', skipping weather generation");
Season = ESeason.Summer;
WeatherReady = true;
Season = ESeason.Summer;
OfflineRaidSettingsMenuPatch_Override.UseCustomWeather = false;

return;
Expand Down Expand Up @@ -1635,7 +1635,6 @@ private async Task GenerateWeathers()
}
}

WeatherReady = true;
OfflineRaidSettingsMenuPatch_Override.UseCustomWeather = false;
}

Expand Down Expand Up @@ -1671,10 +1670,13 @@ private async Task GetWeather()
FikaClient client = Singleton<FikaClient>.Instance;
client.SendData(ref packet, DeliveryMethod.ReliableUnordered);

while (WeatherClasses == null)
while (!WeatherReady)
{
await Task.Delay(1000);
client.SendData(ref packet, DeliveryMethod.ReliableUnordered);
if (!WeatherReady)
{
client.SendData(ref packet, DeliveryMethod.ReliableUnordered);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Coop/GameMode/IFikaGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public interface IFikaGame

public void Stop(string profileId, ExitStatus exitStatus, string exitName, float delay = 0f);

public ESeason Season { get; set; }
public ESeason Season { get; internal set; }

public SeasonsSettingsClass SeasonsSettings { get; set; }
public SeasonsSettingsClass SeasonsSettings { get; internal set; }
}
}

0 comments on commit c10640a

Please sign in to comment.