Giter VIP home page Giter VIP logo

battleofmages's Introduction

#Battle of Mages

##General info

An open source MOBA, see https://battleofmages.com for more info.

##Code Style Guide

###TL;DR

using System;
using System.Collections.Generic;

namespace Example {
	// Test
	public class Test {
		public string firstField;
		public string secondField;
		
		private string privateField;
		
		// Start
		void Start() {
			var x = 42;
			var y = 1337;
			
			// This is an awesome if statement
			if(false) {
				//DisabledCode();
			} else {
				//DisabledCode();
			}
		}
		
		// Update
		public void Update(string[] args) {
			for(int i = 0; i < 10; i++) {
				Console.WriteLine("{0}: Test", i);
			}
		}
	}
}

Rules

  • Indenting via tabs, aligning via spaces
  • Namespace, class and function names are written in PascalCase
  • Variables are written in camelCase
  • Always use var unless you can't or unless you really want to emphasize the data type
  • Empty line separating the using block and the rest of code
  • Empty line between 2 functions
  • No empty lines at the start or end of the file
  • Comments start with // followed by a space
  • Disabled code starts with // not followed by a space
  • Always add a comment directly above the function definition containing the function name or an explanation
  • One using declaration per line, no empty lines between them
  • No spaces before the bracket of a function call or array index access
  • One space before the opening bracket { of a block
  • One space after the ending bracket } of a block if it is followed by a second block (e.g. else, catch, ...)
  • Follow-up blocks like else and catch are written on the same line as the ending bracket } of the preceding block
  • A comment // that is not at the first line of a block needs to be preceded by a new line
  • Private class fields need to explicitly state that they are private
  • The very first block in a source file is not preceded by a comment
  • A block requires a new empty line before and after it if there is more code in the same block

battleofmages's People

Contributors

akyoto avatar azuna1 avatar mathias234 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.