diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-10-27 19:25:50 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-10-27 19:25:50 +0100 |
commit | 867823f4429b1215cd5c3aa6d2415fb324429891 (patch) | |
tree | 2915f6c2e0acae69ad2b738e0038766354d60856 /src/device_allocation.cc | |
parent | f005efee43bdb2e9749b02f73b876bf2c1145f1b (diff) | |
parent | 47fb7807d77c92fa6e72017501d9355d780adf40 (diff) |
Merge branch 'cpp'
Diffstat (limited to 'src/device_allocation.cc')
-rw-r--r-- | src/device_allocation.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/device_allocation.cc b/src/device_allocation.cc new file mode 100644 index 00000000..ec2d208c --- /dev/null +++ b/src/device_allocation.cc @@ -0,0 +1,20 @@ +#include "device_allocation.hpp" + +#include <cassert> + +static void device_allocation_init(device_allocation *device_allocation, byte tval) +{ + assert(device_allocation != NULL); + + device_allocation->tval = tval; + device_allocation->rarity = 0; + range_init(&device_allocation->base_level, 0, 0); + range_init(&device_allocation->max_level, 0, 0); +} + +device_allocation *device_allocation_new(byte tval) +{ + device_allocation *d = new device_allocation; + device_allocation_init(d, tval); + return d; +} |