Progressing fixes
This commit is contained in:
1 parent
d00ce7bb0e
commit
0619ada74f
62 files changed
+81418
-72853
No files matched your search
@@ -45,7 +45,14 @@ namespace Code.OfficeGame.BattleMode.Timeline
|
||||
_cameraStateMachine = cameraStateMachine;
|
||||
_battleActionDecisionPanel = battleActionDecisionPanel;
|
||||
_timelinePanel = timelinePanel;
|
||||
_battleActions = battleActions.ToDictionary(x => x.ActionType);
|
||||
|
||||
_battleActions = new();
|
||||
foreach (var battleAction in battleActions)
|
||||
{
|
||||
battleAction.SetBattleTimeline(this);
|
||||
_battleActions.Add(battleAction.ActionType, battleAction);
|
||||
}
|
||||
|
||||
_battleActionDeciders = battleActionDeciders.ToDictionary(x => x.DeciderType);
|
||||
}
|
||||
|
||||
@@ -149,12 +156,24 @@ namespace Code.OfficeGame.BattleMode.Timeline
|
||||
|| !actionDataSnapshots.TryGetValue(entityId, out var battleActionData))
|
||||
continue;
|
||||
|
||||
bool actionChanged = false;
|
||||
|
||||
if (!_actionDecisionResults.TryAdd(entityId, actionDecisionResult))
|
||||
_actionDecisionResults[entityId]?.RestoreSnapshot(actionDecisionResult);
|
||||
{
|
||||
actionChanged = actionDecisionResult.ActionType !=
|
||||
_actionDecisionResults[entityId].ActionType;
|
||||
if(actionChanged)
|
||||
_actionDecisionResults[entityId] = actionDecisionResult;
|
||||
else
|
||||
_actionDecisionResults[entityId]?.RestoreSnapshot(actionDecisionResult);
|
||||
}
|
||||
|
||||
if (!_battleActionDatas.TryAdd(entityId, battleActionData))
|
||||
_battleActionDatas[entityId]?.RestoreSnapshot(battleActionData);
|
||||
|
||||
{
|
||||
if(actionChanged) _battleActionDatas[entityId] = battleActionData;
|
||||
else _battleActionDatas[entityId]?.RestoreSnapshot(battleActionData);
|
||||
}
|
||||
|
||||
entity.RestoreSnapshot(entitySnapshots[entityId]);
|
||||
}
|
||||
}
|
||||
@@ -290,8 +309,6 @@ namespace Code.OfficeGame.BattleMode.Timeline
|
||||
decisionResult = await _battleActionDeciders[deciderType].GetDecision();
|
||||
decisionResult.ActionType = decidedActionType;
|
||||
|
||||
Debug.Log(decisionResult.ResultCode);
|
||||
|
||||
actionData = _battleActions[decidedActionType].MountAndGetFrames(entity, decisionResult);
|
||||
|
||||
previewCancellationToken.Cancel();
|
||||
@@ -331,5 +348,17 @@ namespace Code.OfficeGame.BattleMode.Timeline
|
||||
|
||||
return (decisionResult, actionData);
|
||||
}
|
||||
|
||||
public void ForceDecideAction(
|
||||
EntityId entityId,
|
||||
BattleActionData forcedBattleActionData,
|
||||
BattleActionDecisionResult forcedBattleActionDataResult)
|
||||
{
|
||||
|
||||
_battleActionDatas[entityId] = forcedBattleActionData;
|
||||
_actionDecisionResults[entityId] = forcedBattleActionDataResult;
|
||||
|
||||
Debug.Log($"Задано действие {forcedBattleActionDataResult.ActionType} для {entityId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user