2 // **********************************************************************
3 // The Cheat - A universal game cheater for Mac OS X
4 // (C) 2003-2005 Chaz McGarvey (BrokenZipper)
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)
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.
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.
21 #import <Cocoa/Cocoa.h>
23 #import "CheaterTypes.h"
28 #define TC_MAX_VAR_SIZE (256)
31 @interface Variable
: NSObject
< NSCoding
>
40 // use the accessor methods unless you need fast access
41 // do not change these variables directly or things will be screwed.
43 TCIntegerSign _integerSign
;
48 // #############################################################################
49 #pragma mark Initialization
50 // #############################################################################
52 // type and sign can't be changed once variable is created.
54 - (id
)init
; // default: TCInt32
55 - (id
)initWithType
:(TCVariableType
)type
; // default: TCSigned
56 - (id
)initWithType
:(TCVariableType
)type integerSign
:(TCIntegerSign
)sign
;
58 // #############################################################################
60 // #############################################################################
62 - (id
)initWithCoder
:(NSCoder
*)coder
;
63 - (void)encodeWithCoder
:(NSCoder
*)coder
;
65 // #############################################################################
66 #pragma mark Accessors
67 // #############################################################################
69 - (TCVariableType
)type
;
70 - (TCIntegerSign
)integerSign
;
71 - (NSString
*)typeString
;
74 - (void)setAddress
:(TCAddress
)addr
;
75 - (NSString
*)addressString
;
76 - (BOOL
)setAddressString
:(NSString
*)string
;
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
;
84 - (unsigned)valueSize
;
88 - (void)setEnabled
:(BOOL
)enabled
;
91 - (void)setTag
:(int)tag
;