Our next app will be a Currency Converter app that allows users to enter a monetary amount and currency and then converts that amount to another currency. This conversion app uses a free currency web service to find the list of available currencies, and the conversion rates between any two currencies. We will learn how … Continue reading App-Idea 5: Currency Converter
Tag: mvvm
App-Idea 4: Dollar to Cents App
Our next app will take a dollar value input string, convert it to the number of cents, and then determine how much of each type of coin that represents (Dollar to Cents app). The coin conversion should output the fewest coins possible. And, we will investigate building a table dynamically on a Blazor page to … Continue reading App-Idea 4: Dollar to Cents App
App-Idea 3: Ultra Number Converter
Inspired by the number converters in the app-ideas project, I decided to create an uber number converter that allows users to pick from various number systems and convert to another one... instead of build more converters for octal and hexadecimal. Plus, this allows us to learn about build more complex UI in Blazor. In this … Continue reading App-Idea 3: Ultra Number Converter
App-Idea 1: Bin2Dec
Our first project (Bin2Dec) will be a converter that takes binary numbers from input strings and converts them to their decimal value. And, we will add the ability to convert back from decimals to binary numbers as well. There are several converters in the project list, so we will create a single Blazor app with … Continue reading App-Idea 1: Bin2Dec
Lesson 3.7: Displaying Game Messages
As the player interacts with the game world (including combat), we need to display messages in the game screen: combat messages, damage done to creatures, healing, and more. We are going to do this by having the GameSession view model expose the Messages property. The Messages property is then data bound to the UI. DisplayMessage … Continue reading Lesson 3.7: Displaying Game Messages
Lesson 2.9: Creating The Game World
The location was a single spot in a larger game world. We want to represent the game world as a grid of places that the player can move to. We will manage that by creating a new World model class that encapsulates the structure of the world and exposes some methods for retrieving location data. … Continue reading Lesson 2.9: Creating The Game World
Lesson 2.8: Game Location
Now that we have our core design components in place (MVVM, Dependency Injection, Blazor components, and unit test coverage), we are going to focus on building out more game functionality. We will start with the game location. This lesson will add a Model class, update the view model, create a Blazor component to show the … Continue reading Lesson 2.8: Game Location
Lesson 2.4: Testing the MVVM Components
Now that we've put together all of the MVVM components, we're going to take a quick look at the testing across these components. View Model Tests We have already looked at the Player unit test in Lesson 2.1. Now, let's create some tests for the GameSession view model. In the SimpleRPG.Game.Engine.Tests project, create the GameSessionTests … Continue reading Lesson 2.4: Testing the MVVM Components
Lesson 2.3: Connecting Player – GameSession – Game Screen
We are going to complete the MVVM cycle by defining the view for our game - the Game Screen - to display and interact with the GameSession view model and the Player class. As a reminder of the MVVM design pattern: Fig 1 - MVVM pattern diagram To enable the View portion of this pattern, … Continue reading Lesson 2.3: Connecting Player – GameSession – Game Screen
Lesson 2.2: Initial GameSession View Model
When building client applications, there are different design patterns for separating the user interface, operations, and data models. For our game project, we will be using the Model-View-ViewModel (MVVM) pattern. Model–view–viewmodel (MVVM) is a software design pattern that helps with the separation of the development of the graphical user interface (the view) from the development … Continue reading Lesson 2.2: Initial GameSession View Model