Wheredidigo
Community Developer
- Joined
- Dec 15, 2013
- Messages
- 417
Mastahg,
Right now, I can use the above enum to filter items coming out of GameObjectManager.GameObjects. I would like to then cast the objects to their appropriate type and that is where things are not entirely clear.
Looking at the Object Browser, I can see the following types in ff14bot.Objects
Can you give us an idea of what actual object the GameObjectType Enums actually can be cast to.
As an example, this the the code I'm looking at implementing:
Thanks,
-Wheredidigo
Code:
namespace ff14bot.Enums
{
public enum GameObjectType : byte
{
Pc = 1,
BattleNpc = 2,
EventNpc = 3,
Treasure = 4,
AetheryteObject = 5,
GatheringPoint = 6,
EventObject = 7,
Mount = 8,
Minion = 9,
Retainer = 10,
HousingEventObject = 12
}
}
Right now, I can use the above enum to filter items coming out of GameObjectManager.GameObjects. I would like to then cast the objects to their appropriate type and that is where things are not entirely clear.
Looking at the Object Browser, I can see the following types in ff14bot.Objects

Can you give us an idea of what actual object the GameObjectType Enums actually can be cast to.
As an example, this the the code I'm looking at implementing:
Code:
public AsyncObservableCollection<BattleCharacter> PcObjects => new AsyncObservableCollection<BattleCharacter>(GameObjects.Where(x => x.Type == GameObjectType.Pc).Select(x => x as BattleCharacter));
public AsyncObservableCollection<BattleCharacter> BattleNpcObjects => new AsyncObservableCollection<BattleCharacter>(GameObjects.Where(x => x.Type == GameObjectType.BattleNpc).Select(x => x as BattleCharacter));
public AsyncObservableCollection<Character> EventNpcObjects => new AsyncObservableCollection<Character>(GameObjects.Where(x => x.Type == GameObjectType.EventNpc).Select(x => x as Character));
public AsyncObservableCollection<Treasure> TreasureObjects => new AsyncObservableCollection<Treasure>(GameObjects.Where(x => x.Type == GameObjectType.Treasure).Select(x => x as Treasure));
public AsyncObservableCollection<Aetheryte> AetheryteObjectObjects => new AsyncObservableCollection<Aetheryte>(GameObjects.Where(x => x.Type == GameObjectType.AetheryteObject).Select(x => x as Aetheryte));
public AsyncObservableCollection<GatheringPointObject> GatheringPointObjects => new AsyncObservableCollection<GatheringPointObject>(GameObjects.Where(x => x.Type == GameObjectType.GatheringPoint).Select(x => x as GatheringPointObject));
public AsyncObservableCollection<EventObject> EventObjectObjects => new AsyncObservableCollection<EventObject>(GameObjects.Where(x => x.Type == GameObjectType.EventObject).Select(x => x as EventObject));
public AsyncObservableCollection<BattleCharacter> MountObjects => new AsyncObservableCollection<BattleCharacter>(GameObjects.Where(x => x.Type == GameObjectType.Mount).Select(x => x as BattleCharacter));
public AsyncObservableCollection<Minion> MinionObjects => new AsyncObservableCollection<Minion>(GameObjects.Where(x => x.Type == GameObjectType.Minion).Select(x => x as Minion));
public AsyncObservableCollection<Character> RetainerObjects => new AsyncObservableCollection<Character>(GameObjects.Where(x => x.Type == GameObjectType.Retainer).Select(x => x as Character));
public AsyncObservableCollection<HousingEventObject> HousingEventObjectObjects => new AsyncObservableCollection<HousingEventObject>(GameObjects.Where(x => x.Type == GameObjectType.HousingEventObject).Select(x => x as HousingEventObject));
Thanks,
-Wheredidigo