Skip to content

Commit

Permalink
More work on the ship fitter
Browse files Browse the repository at this point in the history
  • Loading branch information
matttyson committed Jul 25, 2010
1 parent 63bbd00 commit e988ad3
Show file tree
Hide file tree
Showing 15 changed files with 658 additions and 60 deletions.
100 changes: 100 additions & 0 deletions src/Core/Fitter/FitterMacros.h
@@ -0,0 +1,100 @@
/*
This file is part of Mac Eve Tools.
Mac Eve Tools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mac Eve Tools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mac Eve Tools. If not, see <http://www.gnu.org/licenses/>.
Copyright Matt Tyson, 2009.
*/


enum CCPAttributeID
{
attrLowSlots = 12,
attrMedSlots = 13,
attrHiSlots = 14,
attrRigSlots = 1337,
attrSubSystemSlot = 1366
};

enum CCPEffectID
{
effectLoPower = 11,
effectMedPower = 13,
effectHiPower = 12
};

/*Slot type values for the ship fitter*/
enum SlotType
{
slotHigh,
slotMid,
slotLow,
slotRigS,
slotRigM,
slotRigL,
slotSubsystem
};
typedef enum SlotType SlotType;


/*
This largley copied from EveHQ written by Vessper
*/

enum EffectType
{
effectAll = 0,
effectItem = 1,
effectGroup = 2,
effectCategory = 3,
effectMarketGroup = 4,
effectSkill = 5,
effectSlot = 6,
effectAttribute = 7
};

enum EffectCalcType
{
calcPercentage = 0,
calcAddition = 1,
calcDifference = 2,
calcVelocity = 3,
calcAbsolute = 4,
calcMultiplier = 5,
callAddPositive = 6,
calcAddNegative = 7,
calcSubtraction = 8,
calcCloakedVelocity = 9,
calcSkillLevel
};

enum EffectStackType
{
stackNone = 0,
stackStandard = 1,
stackGroup = 2,
stackItem = 3
};

/*End vessper EveHQ stuff.*/


#define MAX_HIGH_SLOTS 8
#define MAX_MID_SLOTS 8
#define MAX_LOW_SLOTS 8
#define MAX_RIG_SLOTS 3
#define MAX_SUBSYSTEM_SLOTS 6

55 changes: 42 additions & 13 deletions src/Core/Fitter/FittingObject.h
@@ -1,30 +1,59 @@
//
// FittingObject.h
// Mac Eve Tools
//
// Created by Matt Tyson on 20/06/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
/*
This file is part of Mac Eve Tools.
Mac Eve Tools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mac Eve Tools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mac Eve Tools. If not, see <http://www.gnu.org/licenses/>.
Copyright Matt Tyson, 2009.
*/


#import <Cocoa/Cocoa.h>

#import "macros.h"

#import "FitterMacros.h"


/*
Represents an object that can be fitted to a ship,
be it a High,Mid,Low,Subsytem or Rig slot item.
*/

@interface FittingObject : NSObject {
@class ModuleCharge;

@interface FittingObject : NSObject {
NSInteger typeID;
NSDictionary *attributes; //All the attriubutes that this object posseses

ModuleCharge *charge; //The charge fitted to this module, if it is capable of holding charges.
}

-(BOOL) isActive;
-(BOOL) canOverheat;
-(enum SlotType) slotType;
-(BOOL) hasAmmo; // Either weapon ammo such as missiles or charges, or scripts for sensor boosters etc.
-(FittingObject*) initWithTypeID:(NSInteger)tID andAttributes:(NSDictionary*)attrs;

-(BOOL) isActive; // The module can be activated.
-(BOOL) canOverheat; // The module can be overheated.
-(enum SlotType) slotType; // The slot type that this module belongs to.
-(BOOL) hasCharges; // Either weapon ammo such as missiles or charges, or scripts for sensor boosters etc.

-(ModuleCharge*) charge;
-(void) setCharge:(ModuleCharge*)chrg;


//Return the float value of an attribute.
-(CGFloat) valueForAttribute:(enum CCPAttributeID)attributeID;


-(CGFloat) valueForAttribute:(NSInteger)attributeID;

@end
76 changes: 69 additions & 7 deletions src/Core/Fitter/FittingObject.m
@@ -1,14 +1,76 @@
//
// FittingObject.m
// Mac Eve Tools
//
// Created by Matt Tyson on 20/06/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
/*
This file is part of Mac Eve Tools.
Mac Eve Tools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mac Eve Tools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mac Eve Tools. If not, see <http://www.gnu.org/licenses/>.
Copyright Matt Tyson, 2009.
*/


#import "FittingObject.h"


@implementation FittingObject


-(FittingObject*) initWithTypeID:(NSInteger)tID andAttributes:(NSDictionary*)attrs
{
if((self = [super init])){
typeID = tID;
attributes = [attrs retain];
}
return self;
}

-(void)dealloc
{
[attributes release];
[super dealloc];
}

-(BOOL) isActive
{
return NO;
}

-(BOOL) canOverheat
{
return NO;
}

-(enum SlotType) slotType
{
return 0;
}

-(BOOL) hasCharges
{
return NO;
}

-(ModuleCharge*) charge
{
return nil;
}

-(void) setCharge:(ModuleCharge*)chrg
{
}

-(CGFloat) valueForAttribute:(enum CCPAttributeID)attributeID
{
return 0.0;
}

@end
22 changes: 22 additions & 0 deletions src/Core/Fitter/ModuleCharge.h
@@ -0,0 +1,22 @@
//
// ModuleCharge.h
// Mac Eve Tools
//
// Created by Matt Tyson on 25/07/10.
// Copyright 2010 Sebastian Kruemling. All rights reserved.
//

#import <Cocoa/Cocoa.h>


/*
Represents 'ammo' that can be fitted to a module.
Either it's actuall ammuntion, such as Antimatter L, etc or a mining crystal, a script for a tracking disruptor.
something like that.
*/

@interface ModuleCharge : NSObject {

}

@end
14 changes: 14 additions & 0 deletions src/Core/Fitter/ModuleCharge.m
@@ -0,0 +1,14 @@
//
// ModuleCharge.m
// Mac Eve Tools
//
// Created by Matt Tyson on 25/07/10.
// Copyright 2010 Sebastian Kruemling. All rights reserved.
//

#import "ModuleCharge.h"


@implementation ModuleCharge

@end
44 changes: 44 additions & 0 deletions src/Core/Fitter/ShipEffect.h
@@ -0,0 +1,44 @@
/*
This file is part of Mac Eve Tools.
Mac Eve Tools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mac Eve Tools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mac Eve Tools. If not, see <http://www.gnu.org/licenses/>.
Copyright Matt Tyson, 2009.
*/


#import <Cocoa/Cocoa.h>

#import "FitterMacros.h"

@interface ShipEffect : NSObject {
NSInteger shipTypeID; // TypeID of the ship.
enum EffectType affectingType; //

NSInteger affectingID; // The TypeID of the skill that is causing this effect
NSInteger affectingAttributeID; // the attributeID that this effect is applied to

enum EffectType affectedType; // ???
NSMutableArray *affectedTypeID; //A list of typeIDs that are affected by this

enum EffectStackType stackingNerf; // Something to do with how the stacking nerf is calculated.
BOOL isPerLevel; // Not entierly sure yet. maybe it means this attribute is applied once per level.

enum EffectCalcType calcType; // How is this attribute calculated?

NSInteger status; // ??
CGFloat value;
}

@end
26 changes: 26 additions & 0 deletions src/Core/Fitter/ShipEffect.m
@@ -0,0 +1,26 @@
/*
This file is part of Mac Eve Tools.
Mac Eve Tools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mac Eve Tools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mac Eve Tools. If not, see <http://www.gnu.org/licenses/>.
Copyright Matt Tyson, 2009.
*/


#import "ShipEffect.h"


@implementation ShipEffect

@end
25 changes: 18 additions & 7 deletions src/Core/Fitter/ShipFitter.h
@@ -1,10 +1,21 @@
//
// ShipFitter.h
// Mac Eve Tools
//
// Created by Matt Tyson on 2/05/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
/*
This file is part of Mac Eve Tools.
Mac Eve Tools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mac Eve Tools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mac Eve Tools. If not, see <http://www.gnu.org/licenses/>.
Copyright Matt Tyson, 2009.
*/

#import <Cocoa/Cocoa.h>

Expand Down

0 comments on commit e988ad3

Please sign in to comment.