public Input_AI_Expand(Input_AI input, IBattleField battlefield, CharController_Direct _self, FB.FFSM.AI_StateTable table, AILevel aiLevel) { this.selfCC = _self; this.battlefield = battlefield; this.input = input; this.aiLevel = aiLevel; this.ai_table = table; //ai改变属性 AILevelChange(); vIdlePos = (battlefield as BattleField).GetRealChar(selfCC.idCare).transform.position; enemyCC = battlefield.GetAllCCBySide(1)[0] as CharController_Direct; //enemyCC.SetCCLife(0); stateTable = (battlefield as BattleField).GetRealChar(selfCC.idCare).transform.GetComponent <FB.FFSM.com_FightFSM>().stateTable; Start(); ChangeState(StateMachine.idle); ai_attackstate_map = new Dictionary <int, List <AI_StateItem> >(); for (int i = 0; i <= 3; i++) { ai_attackstate_map[i] = new List <AI_StateItem>();//0 移动系列 } if (ai_table == null || ai_table.allstates == null) { return; } foreach (var a in ai_table.allstates) { ai_attackstate_map[a.attacktype].Add(a); } }
public void StartMove(BoardManager argBoardManager, AILevel aiLevel, int argMoveRound, TurnAtuoTimer argTimer) { boardManager = argBoardManager; moveRound = argMoveRound; timer = argTimer; switch (aiLevel) { case AILevel.easy: moveThread = new Thread(new ThreadStart(MoveInEasyLevel)); moveThread.Start(); break; case AILevel.middle: moveThread = new Thread(new ThreadStart(MoveInMiddleLevel)); moveThread.Start(); break; case AILevel.hard: moveThread = new Thread(new ThreadStart(MoveInHardLevel)); moveThread.Start(); break; default: moveThread = new Thread(new ThreadStart(MoveInMiddleLevel)); moveThread.Start(); break; } StartCoroutine(OnMove()); }
public WinBoard(PlayerColor color, AILevel aiLevel, string startFen, string engine) { this.color = color; this.AILevel = aiLevel; this.startFen = startFen; var psi = new ProcessStartInfo { UseShellExecute = false, CreateNoWindow = true, FileName = "engines\\polyglot", Arguments = "engines\\" + engine + ".ini", RedirectStandardInput = true, RedirectStandardOutput = true }; this.process = Process.Start(psi); this.output = this.process.StandardOutput; this.input = this.process.StandardInput; }
private string getAIName(AILevel type) { switch (type) { case AILevel.Advanced: return(Properties.Resources.AdvancedAI); case AILevel.Intermediate: return(Properties.Resources.IntermediateAI); case AILevel.Elementary: return(Properties.Resources.ElementaryAI); } return(string.Empty); }
public PlayerController[] InitializePlayers(int count, AILevel aiLevel, byte moveDistance, byte captureDistance) { PlayerController[] players = new PlayerController[count]; for (int i = 0; i < count; i++) { GameObject obj = new GameObject(string.Format("Player{0}", i)); PlayerController player = obj.AddComponent <PlayerController>(); switch (i) { case 0: player.Initialize(Color.blue, aiLevel); break; case 1: player.Initialize(Color.red, aiLevel); break; case 2: player.Initialize(Color.green, aiLevel); break; case 3: player.Initialize(Color.magenta, aiLevel); break; } player.MoveDistance = moveDistance; player.CaptureDistance = captureDistance; players[i] = player; } if (count < 4) { for (int i = count; i < 4; i++) { score[i].SetActive(false); } } players[0].IsVictim = true; board.SetPlayers(players); return(players); }
private void setDeep(AILevel level) { deep = 20; switch (level) { case AILevel.Advanced: break; case AILevel.Intermediate: deep = 10; break; case AILevel.Elementary: deep = 1; break; } }
public void Setup(PlayerName playerName, AILevel level) { this.playerName = playerName; aiLevel = level; name += " " + ((int)playerName + 1).ToString(); SetupZones(); aiAnimator = GetComponent <Animator> (); if (!GlobalVariables.Instance.dynamicCamera.targetsList.Contains(gameObject) && SceneManager.GetActiveScene().name == "Scene Testing") { GlobalVariables.Instance.dynamicCamera.otherTargetsList.Add(gameObject); } GetComponent <AIFXAnimations> ().AISetup(); }
internal EVPResolver(IBoard board, AILevel level) { Board = board; Judges.onAttach(); //Attach proxy JoinToken = TokenHelper.NewToken(); HostToken = TokenHelper.NewToken(); shareProxy = new LocalProxy(RelayMessage); shareProxy.Token = TokenHelper.NewToken(); Judges.AttachProxy(shareProxy); //Subscribe event board.LatticClick += onLatticClick; //Generate token and store it. tokens = new List <string>(2); tokens.Add(JoinToken); tokens.Add(HostToken); setDeep(level); }
public void Initialize(Color color, AILevel aiLevel) { this.Color = color; this.AILevel = aiLevel; switch (aiLevel) { case AILevel.Easy: this.ai = new EasyAI(this.levelManager, this); break; case AILevel.Normal: this.ai = new NormalAI(this.levelManager, this); break; case AILevel.Hard: this.ai = new HardAI(this.levelManager, this); break; default: throw new ArgumentOutOfRangeException("Текущий уровень сложности не поддерживается. AILevel = " + aiLevel); } }
/// <summary> /// Sets the current AI Level of the creature to the value specified. Does not work on Players. /// The game by default will choose an appropriate AI level for /// creatures based on the circumstances that the creature is in. /// Explicitly setting an AI level will over ride the game AI settings. /// The new setting will last until SetAILevel is called again with the argument AI_LEVEL_DEFAULT. /// AI_LEVEL_DEFAULT - Default setting. The game will take over seting the appropriate AI level when required. /// AI_LEVEL_VERY_LOW - Very Low priority, very stupid, but low CPU usage for AI. Typically used when no players are in /// the area. /// AI_LEVEL_LOW - Low priority, mildly stupid, but slightly more CPU usage for AI. Typically used when not in /// combat, but a player is in the area. /// AI_LEVEL_NORMAL - Normal priority, average AI, but more CPU usage required for AI. Typically used when creature is /// in combat. /// AI_LEVEL_HIGH - High priority, smartest AI, but extremely high CPU usage required for AI. Avoid using this. It is /// most likely only ever needed for cutscenes. /// </summary> public static void SetAILevel(uint oTarget, AILevel nAILevel) { Internal.NativeFunctions.StackPushInteger((int)nAILevel); Internal.NativeFunctions.StackPushObject(oTarget); Internal.NativeFunctions.CallBuiltIn(713); }
public ComputerPlayer(AILevel level = AILevel.Medium) { this.aiLevel = level; }
public (Column Column, int Row) PredictCoordinate( AILevel level, Dictionary <string, CoordinateContainerBase> currentGameBoardState) => level switch
public static IGameCoreResolver BuildEVP(IBoard board, AILevel level) { return(new EVPResolver(board, level)); }