]> Dogcows Code - chaz/thecheat/blob - Variable.h
The Cheat 1.2.3
[chaz/thecheat] / Variable.h
1
2 // **********************************************************************
3 // The Cheat - A universal game cheater for Mac OS X
4 // (C) 2003-2005 Chaz McGarvey (BrokenZipper)
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 1, or (at your option)
9 // any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 //
20
21 #import <Cocoa/Cocoa.h>
22
23 #import "CheaterTypes.h"
24
25 #include <string.h>
26
27
28 #define TC_MAX_VAR_SIZE (256)
29
30
31 @interface Variable : NSObject < NSCoding >
32 {
33 TCAddress _address;
34 BOOL _isValueValid;
35 BOOL _enabled;
36
37 int _tag;
38
39 @public;
40 // use the accessor methods unless you need fast access
41 // do not change these variables directly or things will be screwed.
42 TCVariableType _type;
43 TCIntegerSign _integerSign;
44 unsigned _size;
45 void *_value;
46 }
47
48 // #############################################################################
49 #pragma mark Initialization
50 // #############################################################################
51
52 // type and sign can't be changed once variable is created.
53
54 - (id)init; // default: TCInt32
55 - (id)initWithType:(TCVariableType)type; // default: TCSigned
56 - (id)initWithType:(TCVariableType)type integerSign:(TCIntegerSign)sign;
57
58 // #############################################################################
59 #pragma mark NSCoding
60 // #############################################################################
61
62 - (id)initWithCoder:(NSCoder *)coder;
63 - (void)encodeWithCoder:(NSCoder *)coder;
64
65 // #############################################################################
66 #pragma mark Accessors
67 // #############################################################################
68
69 - (TCVariableType)type;
70 - (TCIntegerSign)integerSign;
71 - (NSString *)typeString;
72
73 - (TCAddress)address;
74 - (void)setAddress:(TCAddress)addr;
75 - (NSString *)addressString;
76 - (BOOL)setAddressString:(NSString *)string;
77
78 - (void const *)value;
79 - (void)setValue:(void const *)value;
80 - (void)setValue:(void const *)value size:(unsigned)size;
81 - (NSString *)stringValue;
82 - (BOOL)setStringValue:(NSString *)value;
83
84 - (unsigned)valueSize;
85 - (BOOL)isValueValid;
86
87 - (BOOL)isEnabled;
88 - (void)setEnabled:(BOOL)enabled;
89
90 - (int)tag;
91 - (void)setTag:(int)tag;
92
93 @end
This page took 0.034301 seconds and 4 git commands to generate.