Consume the PokéAPI (Pokémon API) utilizing just C# language, list the Pokémons and allows the user to chooes a Pokémon for adoption.
-
C# Language
-
.Net Framework
-
PokéAPI
-
Json
-
Create C# code to execte the HTTP GET request.
-
Catch the Json from the request.
-
Print the Json on the console.
Using just the library Rest Sharp was made a request to the PokéAPI and cached the list of Pokémons Json:
-
Parse the Json response and extract each Pokémon info.
-
Show the organized information on the console.
The Json was parsed with the System.Text.Json and the class Mascote and class Ability was created to represent a Pokémon entity.
- Create an interactive menu and allow user to view your current mascots, choose an mascot to adopt and exit the app.
Created Menu class providing user interaction and options to adopt a mascot, view its information and exit the menu.
- Organize the project source files in the MVC (Model view controller) standart.
The application was divided into classes according to Mvc: Model = Ability, Mascote, Pokemon View = Menu Controller = TamagotchiController
- Add common mascote atributos fome, sono, felicidade, canssado, saúde.
- Add mascote actions eat, sleep and play
- Map class Pokemon to class Mascot. Implementation carried out in the mascot class, so that it inherits characteristics from the Pokemon class.
- Build and generate the executable of the application Application published for interactions, using commands, according to documentation.