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();
|
}
|
}
|