Lesson 2.5: Using Blazor Dependency Injection

Dependency injection (DI) is a software design pattern that removes hard-coded dependencies from an object and makes it possible to change those dependencies, whether at run-time or compile-time. This pattern can be used as a simple way to load plugins dynamically or to choose stubs/mock objects in test environments vs. real objects in production environments. … Continue reading Lesson 2.5: Using Blazor Dependency Injection

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

Lesson 1.10: Building Game Splash Screen

After launching the game a few times, I have already gotten tired of seeing the default "Loading..." message on every startup. Luckily there is a way to build our own application splash screen that will display while the Blazor WebAssembly loads on the page. Let's revisit the "./wwwroot/index.html" file. We edited this file earlier to … Continue reading Lesson 1.10: Building Game Splash Screen