/vqdr/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/vqdr/trunk

« back to all changes in this revision

Viewing changes to README

  • Committer: Gustav Hartvigsson
  • Date: 2021-11-16 12:44:52 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20211116124452-g9245bvzwcyy9wk9
Added licencing information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
https://launchpad.net/vqdr
14
14
 
15
15
BUILDING
16
 
 
17
 
  -------------
18
 
  $ mkdir build
19
 
  $ cd build
20
 
  $ meson ..
21
 
  $ ninja
22
 
  -------------
 
16
------------
 
17
$ mkdir build
 
18
$ cd build
 
19
$ meson ..
 
20
$ ninja
 
21
------------
23
22
 
24
23
DICE EXPRESSION SYNTAX
25
24
 
26
 
  A dice expression is simple.
27
 
 
28
 
  ---- Basics ----
29
 
  [n]d[m], [n]t[m] - [n] dices with [m] sides.
30
 
  [e1] [op] [e2]   - Use operator [op] on expressions [e1] and [e2]
31
 
  
32
 
  [func]([e...])   - Use function [func] on the expression(s) [e...]
33
 
  ----------------
34
 
 
35
 
HACKING (DEVELOPMENT GUIDELINES)
36
 
 
37
 
  Please use stardard vala naming convetion. This to make it as easy to read as
38
 
  passible, and minimise any errors when interating with other libraries.
39
 
 
40
 
  INDENTATION
41
 
 
42
 
    Always use two spaces for indentation detween levels.
43
 
  
44
 
  INTEGER TYPES
45
 
 
46
 
    Use int[n] types instead of int and long. This to guarentee that the
47
 
    behviour is the same on all platforms.
48
 
 
49
 
  TYPE NAMES
50
 
    
51
 
    All type names should start with a capital letter, and each word in the name
52
 
    should start with a capital letter. No seperation should be made between
53
 
    the words in the name.
54
 
 
55
 
    --- vala ---
56
 
    class ClownFactory {...}
57
 
    ------------
58
 
 
59
 
  FUNCTIONS AND METHODS
60
 
    
61
 
    Function and method namse should has the standard naming convetion of vala:
62
 
    
63
 
    --- vala ---
64
 
    void foo_bar (int something);
65
 
    -----------
66
 
 
67
 
    * There should be a space befor the paranthesis.
68
 
    * Use underlines to seperate words in the function name.
69
 
 
70
 
    It is advicable to have the function names as short as possible, but also
71
 
    descriptive. Sometimes this leads to a copromise between readability, and
72
 
    brevity.
73
 
 
74
 
  VARIABELS
75
 
 
76
 
    When defining variables use underlines between words:
77
 
 
78
 
    --- vala ---
79
 
    string my_fun_string;
80
 
    -----------
81
 
 
82
 
  ENUMS
83
 
   
84
 
    When defining enums, make sure that the 0'th value is invalid, this to avoid
85
 
    any potential NULL traps.
86
 
 
87
 
    Always define a last value named _NUM_VAL, this will be used for validation
88
 
    of data.
89
 
 
90
 
    --- vala ---
91
 
    enum Clowns {
92
 
      INVALID = 0,
93
 
      BENNY = 1,
94
 
      CARL,
95
 
      CRUSTY,
96
 
      HOMER,
97
 
      _NUM_VAL;
98
 
    }
99
 
    ------------
100
 
 
101
 
    It is advicable to define a to_string method for the enums. To keep track
102
 
    of the to_string functions cases, it is advicable to add a static assert
103
 
    to the body of the function to catch problems at compile time.
104
 
    
105
 
    --- vala ---
106
 
    enum Clowns {
107
 
      ...,
108
 
      _NUM_VAL;
109
 
 
110
 
      public string to_string () {
111
 
        static_assert (Clowns._NUM_VAL == 4 + 1);
112
 
        switch (this) {
113
 
          case (BENNY):
114
 
            return "BENNY";
115
 
          case (CARL):
116
 
            return "CARL";
117
 
          ....
118
 
          default:
119
 
            assert_not_reached ();
120
 
        }
121
 
      }
122
 
    }
123
 
    ------------
124
 
    
 
25
A dice expression is simple.
 
26
 
 
27
---- Basics ----
 
28
[n]d[m], [n]t[m] - [n] dices with [m] sides.
 
29
[e1] [op] [e2]   - Use operator [op] on expressions [e1] and [e2]
 
30
 
 
31
[func]([e...])   - Use function [func] on the expression(s) [e...]
 
32
----------------
 
33
 
 
34