Differences From Artifact [eb5893de54]:
- File src/Variable.m — part of check-in [eac9e3d948] at 2025-03-20 20:59:25 on branch trunk — Convert several files to pure Objective-C (user: js, size: 1546) [annotate] [blame] [check-ins using]
- File src/Variable.mm — part of check-in [89fbd7a152] at 2025-03-20 13:21:56 on branch trunk — Make more use of convenience methods (user: js, size: 1546) [annotate] [blame] [check-ins using]
To Artifact [60a145c003]:
- File
src/Variable.m
— part of check-in
[75e920ae30]
at
2025-03-29 14:25:43
on branch trunk
— Switch from clang-format to manual formatting
clang-format does too many weird things. (user: js, size: 1566) [annotate] [blame] [check-ins using]
1 2 3 4 5 | #import "Variable.h" #include "cube.h" @implementation Variable | | | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #import "Variable.h" #include "cube.h" @implementation Variable + (instancetype)variableWithName: (OFString *)name min: (int)min max: (int)max storage: (int *)storage function: (void (*__cdecl)())function persisted: (bool)persisted { return [[self alloc] initWithName: name min: min max: max storage: storage function: function persisted: persisted]; } - (instancetype)initWithName: (OFString *)name min: (int)min max: (int)max storage: (int *)storage function: (void (*__cdecl)())function persisted: (bool)persisted { self = [super initWithName: name]; _min = min; _max = max; _storage = storage; _function = function; _persisted = persisted; return self; } - (void)printValue { conoutf(@"%@ = %d", self.name, *_storage); } - (void)setValue: (int)value { bool outOfRange = false; if (_min > _max) { conoutf(@"variable is read-only"); return; } |
︙ | ︙ |