I fixed some

This commit is contained in:
ThomasCharester committed 2026-11-10 19:44:21 +03:00
1 parent 1a75cf8461
commit c0dec163cd
688 files changed
+227631 -198871

No files matched your search

@@ -10,9 +10,9 @@ namespace Code.OfficeGame.BattleMode.Snapshots
Dictionary<EntityId, BattleActionData> actionDataSnapshots = new();
Dictionary<EntityId, BattleActionDecisionResult> resultsSnapshots = new();
Dictionary<EntityId, EntitySnapshot> entitySnapshots = new();
public void GetSnapshots(
Dictionary<EntityId, EntityProperties> entities,
Dictionary<EntityId, EntityProperties> entities,
Dictionary<EntityId, BattleActionDecisionResult> actionDecisionResults,
Dictionary<EntityId, BattleActionData> battleActionDatas)
{
@@ -24,6 +24,7 @@ namespace Code.OfficeGame.BattleMode.Snapshots
entity.EntityPreviewVisuals.ShowPreviewState(spawnStaticSnapshotGhost: false);
continue;
}
entity.EntityPreviewVisuals.ShowPreviewState(spawnStaticSnapshotGhost: true);
resultsSnapshots[entityId] = actionDecisionResult.GetSnapshot();
@@ -42,28 +43,17 @@ namespace Code.OfficeGame.BattleMode.Snapshots
if (!resultsSnapshots.TryGetValue(entityId, out var actionDecisionResult)
|| !actionDataSnapshots.TryGetValue(entityId, out var battleActionData))
continue;
// bool actionChanged = false;
//
// if (!actionDecisionResults.TryAdd(entityId, actionDecisionResult))
// {
// actionChanged = actionDecisionResult.ActionType
// != actionDecisionResults[entityId].ActionType;
//
// // if (actionChanged)
actionDecisionResults[entityId] = actionDecisionResult.GetSnapshot();
// else
// actionDecisionResults[entityId]?.RestoreSnapshot(actionDecisionResult);
// }
//
// if (!battleActionDatas.TryAdd(entityId, battleActionData))
// {
// if (actionChanged)
battleActionDatas[entityId] = battleActionData.GetSnapshot();
// else
// battleActionDatas[entityId]?.RestoreSnapshot(battleActionData);
// }
if (actionDecisionResults.TryGetValue(entityId, out var currentDecisionResult) && battleActionDatas.TryGetValue(entityId, out var currentActionData))
{
Debug.Log(
$"Restoring {actionDecisionResult.ActionType} of {currentDecisionResult.ActionType} for {entityId}");
Debug.Log(
$"Also {battleActionData} of {currentActionData} for {entityId}");
}
actionDecisionResults[entityId] = actionDecisionResult.GetSnapshot();
battleActionDatas[entityId] = battleActionData.GetSnapshot();
entity.RestoreSnapshot(entitySnapshots[entityId]);
}
}