本文整理汇总了C#中Bot.BotFileInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Bot.BotFileInfo方法的具体用法?C# Bot.BotFileInfo怎么用?C# Bot.BotFileInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bot
的用法示例。
在下文中一共展示了Bot.BotFileInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayerCommand
// Playe command string
private static string PlayerCommand(Bot bot)
{
string playerCmd = string.Empty;
string ext = bot.BotFileInfo().Extension;
foreach (BotExtension be in botExtensions)
{
string beExt = be.BotExt();
string beCmd = be.BotCommandLine();
if (beExt == ext)
{
if (!string.IsNullOrEmpty(beCmd))
{
playerCmd = "\"" + beCmd + " \\\"" + bot.BotFileInfo().FullName + "\\\"\"";
}
else
{
playerCmd = "\"" + bot.BotFileInfo().FullName + "\"";
}
break;
}
}
return playerCmd;
}
示例2: TestFightsPrepare
// Test fights
private bool TestFightsPrepare()
{
bool prepareFlag = true;
string logsPath = Application.StartupPath + "/logs";
string resultsPath = Application.StartupPath + "/results";
string viewerInputPath = Application.StartupPath + "/viewer_inputs";
if (!Directory.Exists(logsPath))
Directory.CreateDirectory(logsPath);
if (!Directory.Exists(resultsPath))
Directory.CreateDirectory(resultsPath);
if (!Directory.Exists(viewerInputPath))
Directory.CreateDirectory(viewerInputPath);
//Prepare fight
myBot = new Bot(0, (FileInfo)cmbChooseMyBot.SelectedItem, true);
int botId = 1;
List<Bot> opponentBots = new List<Bot>();
if (cmbChooseOpponentBot.SelectedIndex == 0)
{
for (int i = 1; i < cmbChooseOpponentBot.Items.Count; i++)
{
FileInfo fi = (FileInfo)cmbChooseOpponentBot.Items[i];
//if ((cbExampleBots.Checked) && (fi.DirectoryName == (starterPackagePath + "\\example_bots")))
//if ((cbExampleBots.Checked) && (fi.DirectoryName == (Path.GetFullPath(Path.Combine(starterPackagePath, "example_bots")))))
if ((cbExampleBots.Checked) && (fi.DirectoryName == Path.GetFullPath(exampleBotsPath)))
{
Bot opponentBot = new Bot(botId, fi);
opponentBots.Add(opponentBot);
botId++;
}
//if ((cbOtherMyBots.Checked) && (fi.DirectoryName == myBotsPath))
if ((cbOtherMyBots.Checked) && (fi.DirectoryName == Path.GetFullPath(myBotsPath)))
{
if ((cbMirror.Checked) || ((!cbMirror.Checked) && (fi.Name != myBot.BotFileInfo().Name)))
{
Bot opponentBot = new Bot(botId, fi);
opponentBots.Add(opponentBot);
botId++;
}
}
}
}
else
{
Bot opponentBot = new Bot(botId, (FileInfo)cmbChooseOpponentBot.SelectedItem);
opponentBots.Add(opponentBot);
}
List<Map> maps = new List<Map>();
int mapId = 0;
if (cmbMap.SelectedIndex == 0)
{
for (int i = 1; i < cmbMap.Items.Count; i++)
{
FileInfo fi = (FileInfo)cmbMap.Items[i];
Map map = new Map(mapId, fi);
maps.Add(map);
mapId++;
}
}
else
{
Map map = new Map(mapId, (FileInfo)cmbMap.SelectedItem);
maps.Add(map);
}
//Fights
if ((opponentBots.Count > 0) && (maps.Count > 0))
{
botFights = new List<BotFight>();
int fightId = 1;
for (int i = 0; i < opponentBots.Count; i++)
{
for (int j = 0; j < maps.Count; j++)
{
BotFight botFight = new BotFight(fightId, maps[j], myBot, opponentBots[i], turnAmount, timeAmount);
botFights.Add(botFight);
fightId++;
if (cbSwapPlayers.Checked)
{
BotFight botFight2 = new BotFight(fightId, maps[j], opponentBots[i], myBot, turnAmount, timeAmount);
botFights.Add(botFight2);
fightId++;
}
}
}
}
else
{
errorString = string.Empty;
if (opponentBots.Count == 0)
errorString += "There no opponent bots in your current fight settings\n";
if (maps.Count == 0)
errorString += "There no maps in your current fight settings.\n";
prepareFlag = false;
MessageBox.Show(errorString, "Fight Settings warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
//.........这里部分代码省略.........