Skip to content

Latest commit

 

History

History
95 lines (60 loc) · 1.28 KB

CODE_AGREEMENT.md

File metadata and controls

95 lines (60 loc) · 1.28 KB

C# Coding/Scripting Agreement

Namespace

All game c# logic should be wrote in namespace like

namespace CellWar {
    namspace Foo {
        ...
    }
}

or

namespace CellWar.Foo {
    
}

Class Members

m[MemberName]

eg.
Block mHexBlock;

Property

[Capital]xxxx

eg.
int Length { get; set; }

Class Name & Namespace Name

both [Capital]xxxx

eg.
namespace CellWar.Model.Foo {
    public class FooClass {
        ...
    }
}

MVC

The project obeys the MVC pattern, whose Model refers to the CellWar.Model namespace. View refers to all the unity scripts attached to the unity game object.

Model

which refers to the model.cs file for the time being.

View

which refers to all the unity scripts attached to the unity game object.

All unity script, which is attached to the game object, should be named as

U3D_[ScriptName].cs

eg
U3D_CameraLogic.cs

All unity class should be put in namespace like

namespace CellWar.View {
    class U3D_FooLogic : MonoBehavior {
        ...
    }
}

Controller

be left vacant for the time being.

The controller behavior is integreted into the model so far.