public PacmanAIOperator(ThePacman thePacman, Ghost[] ghosts, MapObjectOperator mapObjectOperator, int maxDepthLevel, List <OrdinaryFood> ordinaryFoods) { this.thePacman = thePacman; this.ghosts = ghosts; this.mapObjectOperator = mapObjectOperator; this.directionHeap = new BestDirectionHeap(); this.maxDepthLevel = maxDepthLevel; this.ordinaryFoods = ordinaryFoods; }
private void frmPacman_Load(object sender, EventArgs e) { ImageCreater imageCreater = new ImageCreater(grpBox_GameScreen); thePacman = imageCreater.CreatePacman(); ghosts = imageCreater.CreateGhosts(); ordinaryFoods = imageCreater.CreateFoods(); mapObjectOperator = new MapObjectOperator(grpBox_GameScreen, ordinaryFoods); pacmanMover = new PacmanMover(thePacman, mapObjectOperator); ghostMovers = new GhostMover[ghosts.Length]; pacmanAI = new PacmanAIOperator(thePacman, ghosts, mapObjectOperator, 5, ordinaryFoods); for (int ghostRecorder = 0; ghostRecorder < ghosts.Length; ghostRecorder++) { ghostMovers[ghostRecorder] = new GhostMover(ghosts[ghostRecorder], mapObjectOperator); } LoadGhostMovementUtility(); LoadPacmanMovementUtility(); }