This project is read-only.

A documentation for the class libraries is included as XML documentation in the download.

I'd suggest you read these other pages before starting to work with the library:

1) Download & Setup

Download the latest Clockwise.Base release from the Downloads section.

To make use of Clockwise.Base, take an existing Visual C# project or create a new one. Add a reference to Clockwise.Base.dll, Clockwise.Base.Events.dll and Clockwise.Base.ComponentSystem.dll by right clicking References and selecting Add reference....

2) Summary:

How to: Create a component

  • Create a new class
  • Inherit from Clockwise.Base.Component

How to: Generate component interfaces

  • Add the [Expose] - attribute to the methods and properties of your components which you want to expose.
  • Add a to your project (once).
  • Save the file or click on it with the right mouse button and choose Run custom tool.

How to: Create an entity from your components

  • Create a new interface
  • Make the interface implement Clockwise.Base.IEntity
  • Make the interface implement any component interface you want to have in your entity.
  • Make sure that you resolve any required references you may have in your components. Otherwise, you will encounter a runtime error when building the entity type.

How to: Add an optional or required reference to a component

  • Take a component, add a public field (no property, no private or protected or internal!) and optionally initalize it to null.
  • Make the field type some other component.
  • Add a Clockwise.Base.OptionalAttribute or Clockwise.Base.RequiredAttribute to it.

How to: Instanciate an entity from component types known at runtime

  • Create an instance of the EntityPreset - class using new EntityPreset("Name", new Type[] { ... });
  • Build the entity type using Type t = preset.BuildType();
  • Instanciate the type using preset.Create(), Entity.Create(t), Activator.CreateInstance(t) or any other way you know to instanciate a System.Type.

How to: Instanciate an entity from component types through an entity interface

  • To instanciate an instance of the entity interface IMyEntity, use IMyEntity e = EntityPreset<IMyEntity>.Instanciate().

Last edited Dec 10, 2013 at 3:36 AM by Gandi, version 15


No comments yet.