Sorry for the lack of updates, we've both been busy with irl and I decided to pick up on where we left. I've started rewriting the source and from now on we don't use the 'GetInstance()' that created an instance of the class and followed the singleton pattern but instead (credits to @Joopie) I started reading up on Dependency Injection. I'm now using a IoC container (DI Container) called Autofac. I associate every controller with an interface and then setup the controllers.
PHP Code:
ContainerBuilder builder = new ContainerBuilder();
builder.RegisterType<MainController>();
builder.RegisterType<ControllerLocator>().As<IControllerLocator>();
builder.RegisterType<CatalogController>().As<ICatalogController>();
builder.RegisterType<ClientController>().As<IClientController>();
builder.RegisterType<ItemController>().As<IItemController>();
builder.RegisterType<MessengerController>().As<IMessengerController>();
builder.RegisterType<NavigatorController>().As<INavigatorController>();
builder.RegisterType<PlayerController>().As<IPlayerController>();
builder.RegisterType<RoomController>().As<IRoomController>();
builder.RegisterType<TaskController>().As<ITaskController>();
builder.RegisterType<WordfilterController>().As<IWordfilterController>();
Container = builder.Build();
Controller = Container.Resolve<MainController>();
Controller.SetupControllers();
I've then created a controller locator that I pass as a parameter to the main controller which then locates for me all the controllers.
Screenshot: Screenshot by Lightshot.
I'm fairly new to Dependency Injection and I'll continue reading up on this.
I've also made a Task controller that can execute periodic tasks for me, it's currently being used in the cycling of the rooms. You can currently walk around but there's something wrong in the a* algorithm where it won't find the path to the last point. Once I've done that I'll include some screenshots. :) (Thanks to @Joopie for pointing out Dependency Injection).