/* BWGameData */

#import <Cocoa/Cocoa.h>

@interface BWGameData : NSObject
{
	IBOutlet id matrixAttack;
	
    IBOutlet id matrixMagic;
    IBOutlet id matrixMagicNames;
	IBOutlet id matrixMagicEffects;
	
	IBOutlet id matrixLevels;
    IBOutlet id matrixLevelsNames;
	
	IBOutlet id fieldText;
	IBOutlet id browserText;
	
	IBOutlet id menuSector;
	IBOutlet id menuEnemy;
	IBOutlet id fieldHP;
	IBOutlet id menuPalette;
	IBOutlet id checkFire;
	IBOutlet id checkSteals;
	IBOutlet id menuExpType;
	IBOutlet id tableExperience;
	IBOutlet id tableHits;
	
	IBOutlet id matrixBeginMagic;
	IBOutlet id matrixBeginItems;
	IBOutlet id matrixBeginTechs;
	IBOutlet id fieldBeginLives;
	IBOutlet id sliderBeginCrystals;
	IBOutlet id sliderBeginHC;
	IBOutlet id sliderBeginMC;
	
	IBOutlet id fieldMiscLife;
	IBOutlet id fieldMiscItem;
	
	unsigned char attack[8];
	
	NSMutableArray *textStrings;
	
	NSMutableDictionary *enemies;
	unsigned char ehp[6][40];
	unsigned char ebits[6][40];
	unsigned char hit[8];
	unsigned short exp[16];
	
	NSMutableData *rom;
}

- (void)open:(NSMutableData *)theRom;
- (void)save;

- (void)setAttack;
- (void)saveAttack;

- (void)setMagic;
- (void)setMagicNames;
- (void)setMagicEffects;
- (void)saveMagic;

- (void)setLevels;
- (void)setLevelsNames;
- (void)saveLevels;

- (void)setTextStrings;
- (IBAction)showText:(id)sender;
- (IBAction)confirmText:(id)sender;
- (void)saveText;

- (void)setEnemies;
- (IBAction)changeSector:(id)sender;
- (IBAction)changeEnemy:(id)sender;
- (void)changeHitTable;
- (IBAction)changeHP:(id)sender;
- (IBAction)changePalette:(id)sender;
- (IBAction)changeSteals:(id)sender;
- (IBAction)changeFire:(id)sender;
- (IBAction)changeExpType:(id)sender;
- (void)saveEnemies;

- (void)setBeginning;
- (void)saveBeginning;

- (void)setMisc;
- (void)saveMisc;

- (unsigned char)toASCII:(unsigned char)ctc;
- (unsigned char)fromASCII:(unsigned char)ctc;

@end
