C# Class FFACETools.FFACE.ParseResources

This class will parse the resources.xml file to translate ID <-> Names of spells/abilities/items
Show file Open project: golfandsurf/Campah

Public Properties

Property Type Description
LanguagePreference Languages
ResourcesCache string>.SortedDictionary
UseFFXIDatFiles bool

Private Properties

Property Type Description
CapitalizeWords string
DecodeBlock byte[]
DeleteInstance bool
FindKey int?
FindKeyStartsWith int?
GetFilePath String
GetFilePath String
GetRegistryKey string
IndexIsValid bool
Initialize void
InterpretPath string
LanguageIsValid bool
LoadDMSGFile void
LoadFileIDs void
LoadItemFile void
ParseActualFiles void
ParseResourceFiles void
ParseResources System
RotateRight byte

Public Methods

Method Description
GetAbilityId ( String abil ) : AbilityList

Returns AbilityList for passed String

GetAbilityName ( AbilityList abil ) : String

Will get the name of the passed ability ID

GetAreaId ( String zone ) : Zone

Gets Zone ID for string passed (Exact case insensitive match)

GetAreaName ( Zone id ) : String

Will get the name of the passed area ID

GetDayId ( String day ) : Weekday

Returns Day for passed String

GetDayName ( Weekday day ) : String

Will get the name of the Weekday passed

GetItemID ( String item ) : int
GetItemId ( String item ) : int

Will get the id of the passed item name

GetItemIds ( String item ) : List

Returns a list of matching ids for the string passed. (Twashtar will return a list of 3 different IDs)

GetItemName ( int id ) : String

Will get the name of the passed item ID

GetJobId ( String job ) : Job

Returns Job ID matching string passed or 255 (byte -1) (Exact case insensitive match)

GetLongJobName ( Job job ) : String

Will return the Long Job name for the passed Job enum (Warrior, Monk, White Mage, Black Mage, etc)

GetMoonId ( String phase ) : MoonPhase

Returns MoonPhase id based on string passed. (NOTE: Will return *Gibbous if waxing/waning, never *Gibbous2)

GetMoonPhaseName ( MoonPhase phase ) : String

Will get the name of the Moon Phase passed as a String

GetNationId ( String nation ) : Nation

Returns Nation enum indicating the nation passed (Exact case insensitive match)

GetNationName ( Nation nation ) : String

Will get the name of the Nation passed

Protip: This actually returns the REGION NAME, but it happens to match the Nation enum as well.

GetRaceId ( String race ) : Race

Matches Race enum to beginning of string passed ('mithra female' and 'mithra' are the same)

GetRaceName ( Race race ) : String

Will get the name of the Race passed

GetShortJobName ( Job job ) : String

Will return the Short Job name for the passed Job enum (WAR, MNK, WHM, BLM etc)

GetSpellId ( String spell ) : SpellList

Returns SpellList for passed String

GetSpellName ( SpellList spell ) : String

Will get the name of the passed spell ID

GetStatusEffectName ( StatusEffect statusEffect ) : String

Will get the name of the passed status effect

GetStatusId ( String status ) : StatusEffect

Returns StatusEffect for passed String

GetWeatherId ( String weather ) : Weather

Returns Weather for passed String

GetWeatherName ( Weather weather ) : String

Will get the name of the Weather passed

Private Methods

Method Description
CapitalizeWords ( string value ) : string
DecodeBlock ( byte bytes, int shiftcount ) : byte[]

Decodes a data/text block by reversing the set bit rotation.

DeleteInstance ( ) : bool
FindKey ( String>.IDictionary lookup, String value ) : int?

Internal and private FindKey function for finding a key by value in a Dictionary

FindKeyStartsWith ( String>.IDictionary lookup, String value ) : int?

Internal and private FindKey function for finding a key by value in a Dictionary

GetFilePath ( FileTypes filetype, Languages language ) : String
GetFilePath ( int filetype, int language ) : String
GetRegistryKey ( ) : string

Locates the Registry Key for the FFXI Installation on this computer and pulls the installation folder from it.

IndexIsValid ( int index ) : bool
Initialize ( ) : void
InterpretPath ( UInt16 fileID ) : string

Returns a string in the format ROM\dir\file.DAT given a UInt16 fileID.

LanguageIsValid ( Languages language ) : bool
LoadDMSGFile ( FileTypes type, Languages language, ResourceBit rb ) : void
LoadFileIDs ( string s ) : void

Fills the FileList using the numbers in _fileNumberArray and FTABLE.DAT and VTABLE.DAT as reference.

LoadItemFile ( FileTypes filetype, Languages language ) : void

Generic loader for loading Item names

ParseActualFiles ( ) : void

Entry point into the whole thing.

ParseResourceFiles ( ) : void

Entry point for testing the old way

ParseResources ( ) : System
RotateRight ( byte b, int count ) : byte

Rotates the bits to the right by a set number of places.

Method Details

GetAbilityId() public static method

Returns AbilityList for passed String
public static GetAbilityId ( String abil ) : AbilityList
abil String String containing ability name (Exact case insensitive match)
return AbilityList

GetAbilityName() public static method

Will get the name of the passed ability ID
public static GetAbilityName ( AbilityList abil ) : String
abil AbilityList AbilityList enum indicating the Ability to get the name of.
return String

GetAreaId() public static method

Gets Zone ID for string passed (Exact case insensitive match)
public static GetAreaId ( String zone ) : Zone
zone String String for zone
return Zone

GetAreaName() public static method

Will get the name of the passed area ID
public static GetAreaName ( Zone id ) : String
id Zone ID of the area to get the name for
return String

GetDayId() public static method

Returns Day for passed String
public static GetDayId ( String day ) : Weekday
day String String containing day (fire = firesday, light will bring up Lightningsday, lights = Lightsday)
return Weekday

GetDayName() public static method

Will get the name of the Weekday passed
public static GetDayName ( Weekday day ) : String
day Weekday Weekday enum indicating the String to return
return String

GetItemID() public static method

public static GetItemID ( String item ) : int
item String
return int

GetItemId() public static method

Will get the id of the passed item name
public static GetItemId ( String item ) : int
item String
return int

GetItemIds() public static method

Returns a list of matching ids for the string passed. (Twashtar will return a list of 3 different IDs)
public static GetItemIds ( String item ) : List
item String String to match the ID for (Exact case insensitive match)
return List

GetItemName() public static method

Will get the name of the passed item ID
public static GetItemName ( int id ) : String
id int ID of the item to get the name for
return String

GetJobId() public static method

Returns Job ID matching string passed or 255 (byte -1) (Exact case insensitive match)
public static GetJobId ( String job ) : Job
job String String with either the short or long name of the Job to find.
return Job

GetLongJobName() public static method

Will return the Long Job name for the passed Job enum (Warrior, Monk, White Mage, Black Mage, etc)
public static GetLongJobName ( Job job ) : String
job Job Job enum indicating job string requested.
return String

GetMoonId() public static method

Returns MoonPhase id based on string passed. (NOTE: Will return *Gibbous if waxing/waning, never *Gibbous2)
public static GetMoonId ( String phase ) : MoonPhase
phase String String to return ID for. (Exact case insensitive match)
return MoonPhase

GetMoonPhaseName() public static method

Will get the name of the Moon Phase passed as a String
public static GetMoonPhaseName ( MoonPhase phase ) : String
phase MoonPhase MoonPhase enum indicating the String to return
return String

GetNationId() public static method

Returns Nation enum indicating the nation passed (Exact case insensitive match)
public static GetNationId ( String nation ) : Nation
nation String String containing nation to get enum for.
return Nation

GetNationName() public static method

Will get the name of the Nation passed
Protip: This actually returns the REGION NAME, but it happens to match the Nation enum as well.
public static GetNationName ( Nation nation ) : String
nation Nation Nation enum indicating the String to return
return String

GetRaceId() public static method

Matches Race enum to beginning of string passed ('mithra female' and 'mithra' are the same)
public static GetRaceId ( String race ) : Race
race String String containing race to get enum for.
return Race

GetRaceName() public static method

Will get the name of the Race passed
public static GetRaceName ( Race race ) : String
race Race RaceNames enum indicating the String to return
return String

GetShortJobName() public static method

Will return the Short Job name for the passed Job enum (WAR, MNK, WHM, BLM etc)
public static GetShortJobName ( Job job ) : String
job Job Job enum indicating job string requested.
return String

GetSpellId() public static method

Returns SpellList for passed String
public static GetSpellId ( String spell ) : SpellList
spell String String containing spell name (Exact case insensitive match)
return SpellList

GetSpellName() public static method

Will get the name of the passed spell ID
public static GetSpellName ( SpellList spell ) : String
spell SpellList SpellList enum indicating the Spell to get the name of.
return String

GetStatusEffectName() public static method

Will get the name of the passed status effect
public static GetStatusEffectName ( StatusEffect statusEffect ) : String
statusEffect StatusEffect StatusEffect that you want the in-game name for.
return String

GetStatusId() public static method

Returns StatusEffect for passed String
public static GetStatusId ( String status ) : StatusEffect
status String String containing status (Exact case insensitive match)
return StatusEffect

GetWeatherId() public static method

Returns Weather for passed String
public static GetWeatherId ( String weather ) : Weather
weather String String containing weather (gloomy, stellar glare, etc) -- (gloom matches gloomy in this case)
return Weather

GetWeatherName() public static method

Will get the name of the Weather passed
public static GetWeatherName ( Weather weather ) : String
weather Weather Weather enum indicating the String to return
return String

Property Details

LanguagePreference public static property

Property for indicating preferred language for data to be retreived in.
public static Languages LanguagePreference
return Languages

ResourcesCache public property

public SortedDictionary ResourcesCache
return string>.SortedDictionary

UseFFXIDatFiles public static property

Property for indicating whether to parse xml files or FFXI DAT Files
public static bool UseFFXIDatFiles
return bool