Building an app targeting desktops & mobile
The Mud Designer is currently being developed to support a wide range of operating systems.
- Desktops
- Windows 7
- Windows 8
- Windows 8.1
- OS X
- Mobile
- WinRT 8
- WinRT 8.1
- Windows Phone 8
- Windows Phone 8.1
- iOS
- Android
To facility this, the engine at the lowest level will be wrote using Portable Class Libraries (PCL) so that I can target all of the operating systems with the same low-level codebase. The engine itself will be developed fairly abstractly, implementing a series of patterns that will help facilitate this requirement, with the bulk of the components hidden behind interfaces.
At the moment the engine is broken up in to 4 layers. From the highest layer to the lowest layer, the following provides an idea of what the overall acrchitectural layout looks like.
- App
- Engine
- Data Access
- Services
Each layer is broken down further, to facilitate the level of abstraction needed to provide cross-platform support.
App
The App layer looks like this
- Universal App
- Windows Phone
- WindowsRT
- Shared
- Presentation
- Windows
- Desktop
- Modules
- Infrastructure
As you can see, the mobile apps will be wrote within the Universal App layer while the Windows Desktop apps will be wrote under the Windows layer. Each will be able to target a version of the engine (and it's repositories and services) that is designed specifically for that platform.
I really want to avoid using #if WinRT #elif Win7 #endif
kind of macros through-out the engine, as that makes maintaining it difficult and doesn't provide the level of support I want to provide for 3rd party developers. Since the engine will fully support engine and editor plugins, it needs to be modular and flexible enough to allow other developers to target a specific device or platform if they want, without having to rely on macro's.
For instance, the core project contains an IGame
interface that exposes the following contract.
/// < summary>
/// Gets or Sets the current World for the game. Contains all of the Realms, Zones and Rooms.
/// < /summary>
ICollection< IWorld> Worlds { get; set; }
Since Universal Apps don't support ObservableCollections in the same manor that WPF Desktop apps do, I can implement the IGame in a Desktop library like this.
/// < summary>
/// Gets or Sets the current World for the game. Contains all of the Realms, Zones and Rooms.
/// < /summary>
public ObservableCollection< IWorld> Worlds { get; set; }
This still satisfies the interface's contract, yet provides support for WPF XAML's binding engine. Ideally, I will be able to build an abstract implementation of IGame in the Core engine, and then have the individual platforms inherit and override/implement the specific components that apply to them.
While the solution is still being organized and structured, this is the initial look of how the over-all application suite will be set up.