public async Task <IActionResult> ViewCharacter(string characterName, string characterRealm) { string cName = characterName.ToLower(); string cRealm = characterRealm.ToLower(); ApiHelper.InitialiseClient(); CharacterModel character = await CharacterProcessor.LoadCharacter(cName, cRealm); CharacterStatsModel characterStats = await CharacterProcessor.LoadCharacterStats(cName, cRealm); CharacterDataModel characterData = new CharacterDataModel(); characterData.CharacterData = character; characterData.CharacterStatsData = characterStats; return(View(characterData)); }
public void CharacterProc(CharacterProcessor cp) { foreach (Frame f in FrameList) { foreach (IDisplayListItem dl in f.DisplayList) { if (dl is ICharacterReference) { ICharacter ch = ((ICharacterReference)dl).Character; cp(ch); if (ch is Timeline) { ((Timeline)ch).CharacterProc(cp); } } } } }
public void InitializeNewGame(int tickPeriod) { IGameTile[,] board = BoardFileParser.ParseBoardCsvFile("../../../maze.csv"); GameState = new GameState(board, new Coordinate((int)Math.Round(board.GetLength(0) / 2.0), (int)Math.Round(board.GetLength(1) / 2.0))); TickPeriod = tickPeriod; var pacmanCharacterProcessor = new CharacterProcessor(new PacmanCharacterInteractionProcessor(), new PacmanGameTileInteractionProcessor(), this); var pacmanCharacter = new PacmanCharacter(GameState.BoardState.PlayerSpawnPosition, Direction.East, pacmanCharacterProcessor); GameState.PacmanCharacter = pacmanCharacter; GameState.GameCharacterSet.Add(pacmanCharacter); var ghostCharacterProcessor = new CharacterProcessor(new GhostCharacterInteractionProcessor(), new GhostGameTileInteractionProcessor(), this); GameState.GameCharacterSet.Add(new DumbGhostCharacter(new Coordinate(1, 1), Direction.East, ghostCharacterProcessor, GameState)); GameState.GameCharacterSet.Add(new DumbGhostCharacter(new Coordinate(1, 2), Direction.West, ghostCharacterProcessor, GameState)); GameState.GameCharacterSet.Add(new SmartGhostCharacter(new Coordinate(2, 1), Direction.East, ghostCharacterProcessor, GameState)); }
public CharactersController(CharacterProcessor processor) { _processor = processor; }