Skip to content

Commit 615aa3d

Browse files
committed
2 parents 2805bcf + f81648c commit 615aa3d

File tree

7 files changed

+61
-17
lines changed

7 files changed

+61
-17
lines changed

Docs/About.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# About
22

33
CleaveFramework is maintained by [CleaveTV](https://github.com/cleavetv).
4+
45
You can contact the author directly via email: [email protected]
6+
57
Development began on June 6th, 2014.
8+
9+
Community reddit page available: [CleaveTV Sub-Reddit](http://www.reddit.com/r/CleaveFramework/)

Docs/BinderObject.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@ Binder is a generic binding wrapper for C#'s Dictionary.
99
var intToString = new Binder<int, string>();
1010
// make a binder that binds strings to ints:
1111
var stringToInt = new Binder<string, int>();
12+
```
1213

1314
## Add some bindings:
1415

15-
``csharp
16+
```csharp
17+
// function style
1618
intToString.Bind(11, "eleven");
1719
intToString.Bind(31, "thirty-one");
1820
stringToInt.Bind("eleven", 11);
1921
stringToInt.Bind("thirty-one", 31);
22+
23+
// or with [] operator
24+
intToString[11] = "eleven";
25+
intToString[31] = "thirty-one";
26+
stringToInt["eleven"] = 11;
27+
stringToint["thirty-one"] = 31;
2028
```
2129

2230
## Check a binding:
@@ -38,3 +46,37 @@ if(stringToInt.IsBound("eleven")) {
3846
}
3947
```
4048

49+
## Remove a binding:
50+
51+
```csharp
52+
intToString.Clear(11);
53+
```
54+
55+
## Remove all bindings
56+
57+
```csharp
58+
intToString.Clear();
59+
```
60+
61+
## Reverse resolve, find a list of keys matching a given value
62+
63+
```csharp
64+
var Books = new Binding<string, string>();
65+
var author = "Dr Suess";
66+
Books["Cat In the Hat"] = author;
67+
Books["Green Eggs and Ham"] = author;
68+
Books["The Lorax"] = author;
69+
Books["Hop On Pop"] = author;
70+
author = "Shel Silverstein";
71+
Books["The Giving Tree"] = author;
72+
Books["Where The Sidewalk Ends"] = author;
73+
IEnumerable<string> booksByDrSuess = Books.FindKeyMatches("Dr Suess"); // returns 4 strings matching Dr Suess
74+
IEnumerable<string> booksByShel = Books.FindKeyMatches("Shel Silverstein"); // returns 2 strings matching Shel Silverstein
75+
```
76+
77+
## Size of bindings
78+
79+
```csharp
80+
int binds = Books.Count; // 6
81+
```
82+

Docs/CorePrincipals.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
- SceneView has an abstract method named `Initialize()` which you must implement in your derived `GameSceneView` object. It is within this method that you can begin to set up and start your scene.
88
- The Framework has two "namespaces" reserved for storing and manipulating objects in memory.
99
* Global space
10-
- `Framework` contains a static accessor available at `Framework.Globals` which is the Global space object container.
10+
- `Framework` contains a static accessor available at `Framework.Globals` which is the Global space object container. - A Global object will remain alive for the entire duration of your applications lifetime from the moment you create it until the moment the game closes.
1111
* Scene space.
1212
- `SceneView`'s base class contains a property called `SceneObjects` which is the Scene space object container.
13-
- A Global object will remain alive for the entire duration of your applications lifetime from the moment you create it until the moment the game closes.
14-
- A Scene object will remain alive only up until the point where you tell the framework to change scenes.
13+
- A Scene object will remain alive only up until the point where you tell the framework to change scenes.

Docs/InjectorObject.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Dependency Injector is able to automatically provide objects with resolved depen
44

55
The Injector currently only supports Property and Field injection.
66

7+
## Caching
8+
Injector will cache your objects injectable members the first time it is asked to inject into an object of a given type. Subsequent injections into that type will use the cached values rather then additional reflection which should provide much improved performance.
9+
710
## [Inject] Attribute
811
[Inject] is a C# attribute which precedes the object you want the Injector to inject for you.
912
We can inject into a C# object like:
@@ -73,4 +76,4 @@ object ConstructObjectA(object obj)
7376
```
7477

7578
## Pattern notes:
76-
Binding to interfaces is a very powerful technique which can and should be taken advantage of where ever possible. This gives your code the flexibility to change between concrete implementation types at your discretion without modifying the requesting objects or their usage of the implementation.
79+
Binding to interfaces is a very powerful technique which can and should be taken advantage of where ever possible. This gives your code the flexibility to change between concrete implementation types at your discretion without modifying the requesting objects or their usage of the implementation.

Docs/SceneObjectDataObject.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ A SceneObjects Singleton type is a 1-to-1 mapping of a System.Type to an instanc
3434
#### Adding a singleton
3535
```csharp
3636
// add one specific instance of a Foo
37-
SceneObjects.PushObjectAsSingleton<Foo>(new Foo());
37+
SceneObjects.PushSingleton<Foo>(new Foo());
3838
```
3939

4040
#### Resolving the singleton
@@ -54,7 +54,7 @@ A SceneObjects Transient type is a mapping of a System.Type to a Name/Type insta
5454
```csharp
5555
// add a few instances of Foo named Foo0 through Foo4
5656
for(var i = 0; i < 5; i++) {
57-
SceneObjects.PushObjectAsTransient<Foo>("foo" + i, new Foo());
57+
SceneObjects.PushTransient<Foo>("foo" + i, new Foo());
5858
}
5959
```
6060

Docs/SceneViewObject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ When `SceneView.OnDestroy` is called by the UnityEngine or by your overriden imp
1212

1313
## SceneView.Initialize()
1414

15-
`SceneView.Initialize()` is an abstract method required by your implementations of each `SceneView`. It is automatically invoked by the [SceneManager](SceneManagerObject.md) upon receiving the `SceneLoadedCmd` Command Type.
15+
`SceneView.Initialize()` is an abstract method required by your implementations of each `SceneView`. It is automatically invoked by the [SceneManager](SceneManagerObject.md) upon receiving the `SceneLoadedCmd` Command Type. When execution of this method returns the SceneManager will automatically call `InitializeSceneObjects()` on the current `SceneView`'s instance of `SceneObjectData`
1616

1717
###### `SceneLoadedCmd` is the framework event which occurs after UnityEngine is done building the hierarchy for your scene as serialized by the UnityEditor.

Readme.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CleaveFramework v0.2.0
1+
# CleaveFramework v0.2.1
22

33
A Unity3D C# application framework.
44

@@ -24,14 +24,6 @@ A Unity3D C# application framework.
2424

2525
Most of these features are optional modules you can use as much or as little of as your project requires.
2626

27-
## Why you use a framework
28-
29-
A good application framework allows it's users to save time by using generic code that allows them to focus on more project-specific areas.
30-
31-
A great application framework provides it's users with excellent, fast, well tested, and well maintained generic modules capable of providing their application with a structure they can depend on.
32-
33-
Every piece of software you've even worked with has utilized a framework in one way or another. Whether it was home-rolled or an off the shelf solution the very structure of your code base makes up the framework it executes on. If you've ever finished, or worse started and not finished, a project using the Unity3D engine you realize the importance of well structuring your code. If find yourself re-implementing the same functionality from project to project time and time again then you are a great candidate for migrating your work-flow into a framework package.
34-
3527
## Documentation
3628

3729
### [About](https://github.com/cleavetv/unity-framework/blob/master/Docs/About.md)
@@ -44,4 +36,8 @@ Every piece of software you've even worked with has utilized a framework in one
4436
### [Quick Snippets](https://github.com/cleavetv/unity-framework/blob/master/Docs/QuickSnippets.md)
4537
### [Contributions](https://github.com/cleavetv/unity-framework/blob/master/Docs/Contributions.md)
4638

39+
## Community
40+
41+
If you've got questions, want to request a feature, report a bug, or show off a project using the framework come talk about it on [reddit](http://www.reddit.com/r/CleaveFramework/)
42+
4743

0 commit comments

Comments
 (0)