/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 src/libvqdr/function/roll_and_keep_functon_token.vala

  • Committer: Gustav Hartvigsson
  • Date: 2021-11-11 19:49:21 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20211111194921-ayb9vuhi7wzfucx0
a few things: FastNumbers, simplifications and AbstractPoolToken.

* Swinched Context over to FastNumber

* simmplified logic in Variabel.compare () Variabel.equals ()
  and Variabel.equals_values.

* Tests: Don't use 'new' with structs.

* The Dice class now has a .singel constructor.

* Put RollAndKeepFunctionToken in the corret namespace.

* Added test function for constant value token to the
  token test program.

* Fixed error with test path for GLib.Test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
using VQDR.Expression;
2
2
using VQDR.Common;
3
3
 
4
 
public class RollAndKeepFunctionToken : FunctionToken {
 
4
public class VQDR.Expression.RollAndKeepFunctionToken : FunctionToken {
5
5
  private const int INDEX_ROLL = 1;
6
6
  private const int INDEX_POOL = 1;
7
7
  private const int INDEX_KEEP = 2;
32
32
    pool_size = get_child (INDEX_POOL).result_value.to_int ();
33
33
 
34
34
    if (pool_size > MAX_POOL_SIZE) {
35
 
      throw new ParamError.OUT_OF_BOUNDS (@"Max value $MAX_POOL_SIZE, got $pool_size");
 
35
      throw new ParamError.OUT_OF_BOUNDS
 
36
        (@"($(get_function_name (this.get_type ()))) Max value $MAX_POOL_SIZE, got $pool_size");
36
37
    }
37
38
 
38
39
    if (pool_size < 0) {