yyl
2025-05-15 d341a47ed9bbb740f2ccb9d6d42fd74d5a1c6b5d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System.Collections.Generic;
 
public class BattleField
{
    protected int battleId = 0;
 
    public BattleMode battleMode;
 
    public BattleObjMgr battleObjMgr;
 
    public RecordPlayer recordPlayer;
 
    public int round = 0;
 
    public BattleField()
    {
 
    }
 
    public void Init(int _battleId, int _levelId, BattleMode _battleMode, TeamBase _redTeam, TeamBase _blueTeam = null)
    {
        battleId = _battleId;
        battleMode = _battleMode;
 
        battleObjMgr = new BattleObjMgr();
        battleObjMgr.Init(_levelId, _redTeam, _blueTeam);
 
        recordPlayer = new RecordPlayer();
        recordPlayer.Init(this);
    }
 
    public void Release()
    {
        battleObjMgr.Release();
    }
 
    public void Run()
    {
        recordPlayer.Run();
        battleObjMgr.Run();
    }
 
    public void SetBattleMode(BattleMode _battleMode)
    {
        battleMode = _battleMode;
    }
 
    public void PlayRecord(RecordAction recordAction)
    {
        recordPlayer.PlayRecord(recordAction);
    }
 
    public void PlayRecord(List<RecordAction> recordList)
    {
        recordPlayer.PlayRecord(recordList);
    }
 
    public void OnActionOver(int attackId)
    {
        //
// 手动推点一下发一个包 收一个包 播放一次报文 之后就停住 直到战斗结束的包文
// 自动的话 自动发包 播放报文 后 请求下一个包 循环 直到战斗结束的包文
// 战报播放就是一直播放战报 知道战斗结束的包文
        if (battleMode == BattleMode.Auto)
        {
            // Request next action
        }
        else if (battleMode == BattleMode.Record)
        {
            // Play next record
        }
        else
        {
            // Wait for user input
        }
    }
 
    public void StartGame()
    {
        recordPlayer.StartGame();
    }
}