public string GetProtocol() { if (engine == null) { return("Protocol"); } else { return(CData.ProtocolToStr(engine.protocol)); } }
public CGamer GetGamerPid(int pid, out string protocol) { foreach (CGamer g in gamer) { if (g.bookPro.GetPid() == pid) { protocol = "Book"; return(g); } if (g.enginePro.GetPid() == pid) { protocol = CData.ProtocolToStr(g.engine.protocol); return(g); } } protocol = ""; return(null); }
public void SaveToIni() { name = GetName(); if (hisElo.list.Count == 0) { int e = GetElo(); hisElo.Add(e); hisElo.Add(e); } CEngineList.iniFile.Write($"engine>{name}>tournament", tournament); CEngineList.iniFile.Write($"engine>{name}>modeStandard", modeStandard); CEngineList.iniFile.Write($"engine>{name}>file", file); CEngineList.iniFile.Write($"engine>{name}>protocol", CData.ProtocolToStr(protocol)); CEngineList.iniFile.Write($"engine>{name}>parameters", parameters); CEngineList.iniFile.Write($"engine>{name}>options", options); CEngineList.iniFile.Write($"engine>{name}>elo", elo); CEngineList.iniFile.Write($"engine>{name}>history", hisElo.SaveToStr()); }
void SelectEngine() { optionList.list.Clear(); Uciok(); tbEngineName.Text = engine.name; tbParameters.Text = engine.parameters; cbFileList.Text = engine.GetFile(); cbProtocol.Text = CData.ProtocolToStr(engine.protocol); cbModeStandard.Checked = engine.modeStandard; nudElo.Value = Convert.ToInt32(engine.elo); nudTournament.Value = engine.tournament; if ((engine.protocol == CProtocol.uci) && engine.FileExists()) { if (process.SetProgram($@"{AppDomain.CurrentDomain.BaseDirectory}Engines\{engine.file}", engine.parameters) > 0) { process.WriteLine("uci"); } } }