3 people following this project (follow)

Project Description
The Rainweaver Framework is a collection of common and not so common utilities for game developers using the .NET Framework. Contains an Entity System implementation (work in progress).

Important: this library is free for non-commercial use.

The Entity System project is going through major changes. Stay tuned for future releases.

Donate!

If you find this project useful, helpful, please consider donating!

A Rain Song - Author's blog

A glimpse of the utilities contained in the libraries:

Many useful (and some exotic) extension methods (please browse the Rainweaver.Extension folder under the main project for further details).

ServiceContainer (IoC with autowiring)

// ...

public MainWindowController(IEventAggregator events)
    : base("MainWindowController")
{
    Ensure.That(events).IsNotNull().ElseFailWith(new ArgumentNullException("events"));
    this.Events = events;
    this.Events.RegisterListener(this, typeof(CreateNewProjectEventArgs));
}

// ...

ServiceContainer.Register(new EventAggregator() { AsyncOperation = AsyncOperationManager.CreateOperation(null) });
ServiceContainer.Register<MainWindowController>(); // the IEventAggregator instance is autowired to MainWindowController

// ...

this.controller = ServiceContainer.Get<MainWindowController>();


CVarDictionary
internal class Configuration
    : CVarDictionary
{
    // ...
    public Configuration()
    {
        this.AddCVar("g_width",         800,    Int32Validator);
        this.AddCVar("g_fullscreen",    false,  BooleanValidator);
        this.Load(cfgPath);            
    }
   // ...
}

InputHandler
Program.Input = ServiveContainer.Register(new InputHandler(Program.Screen));
// ...
Program.Input.KeyDown += keyHandlerExitOnEsc;

StateFlow
Program.StateFlow = ServiceContainer.Register(new StateFlow() { ExitApplicationAfterLastState = true });
// ...
Program.StateFlow.EnterState(new AppStates.InitState());
// ...
Program.StateFlow.SwitchToState(new MainMenuState());
// ...
if (arg.KeyCode == Keys.Escape)
{
   Program.StateFlow.ExitCurrentState();
}

ILog implementations
Program.Log = ServiceContainer.Register(new FileLog("arcana.log", false) { PrefixDateTime = true });

Usable
  • ServiceContainer, FileLog, CVarConsole, ApplicationStateManager, InputHandler

Last edited Aug 24 2011 at 11:59 AM by rcollina, version 35