diff Party.h @ 1861:a86c60679949

changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
author Grumpy7
date Mon, 14 Oct 2013 06:32:30 +0200
parents e4e27261d84e
children 768590235c2c
line wrap: on
line diff
--- a/Party.h	Mon Oct 14 03:22:34 2013 +0200
+++ b/Party.h	Mon Oct 14 06:32:30 2013 +0200
@@ -2,6 +2,7 @@
 #include "Player.h"
 #include "NPC.h"
 #include "mm7_data.h"
+#include <array>
 
 
 
@@ -150,14 +151,12 @@
 #pragma pack(push, 1)
 struct PartyTimeStruct
 {
-  //__int64 field_0[10];
-  __int64 bountyHunting_next_generation_time[10];
- // int field_50[170];
-  __int64 Shops_next_generation_time[85];//field_50
-  __int64 _shop_ban_times[53];      
-  unsigned __int64 CounterEventValues[10];  // (0xACD314h in Silvo's binary)
-  __int64 HistoryEventTimes[29];   // (0xACD364h in Silvo's binary)
-  unsigned __int64 _s_times[20]; //5d8 440h+8*51     //(0xACD44Ch in Silvo's binary)
+  std::array<__int64, 10> bountyHunting_next_generation_time;
+  std::array<__int64, 85> Shops_next_generation_time;//field_50
+  std::array<__int64, 53> _shop_ban_times;      
+  std::array<unsigned __int64, 10> CounterEventValues;  // (0xACD314h in Silvo's binary)
+  std::array<__int64, 29> HistoryEventTimes;   // (0xACD364h in Silvo's binary)
+  std::array<unsigned __int64, 20> _s_times; //5d8 440h+8*51     //(0xACD44Ch in Silvo's binary)
 };
 #pragma pack(pop)
 
@@ -269,42 +268,42 @@
   int uNumPrisonTerms;
   unsigned int uNumBountiesCollected;
   int field_74C;
-  __int16 monster_id_for_hunting[5];
-  __int16 monster_for_hunting_killed[5];
+  std::array<__int16, 5> monster_id_for_hunting;
+  std::array<__int16, 5> monster_for_hunting_killed;
   unsigned char   days_played_without_rest;
   unsigned __int8 _quest_bits[64];
-  unsigned __int8 pArcomageWins[16];
+  std::array<unsigned __int8, 16> pArcomageWins;
   char field_7B5_in_arena_quest;
   char uNumArenaPageWins;
   char uNumArenaSquireWins;
   char uNumArenaKnightWins;
   char uNumArenaLordWins;
-  char pIsArtifactFound[29];  //7ba
-  char field_7d7[39];
+  std::array<char, 29> pIsArtifactFound;  //7ba
+  std::array<char, 39> field_7d7;
   unsigned char _autonote_bits[26];
-  char field_818[60];
-  char field_854[32];
+  std::array<char, 60> field_818;
+  std::array<char, 32> field_854;
   int uNumArcomageWins;
   int uNumArcomageLoses;
   unsigned int bTurnBasedModeOn;
   int field_880;
   int uFlags2;
   PartyAlignment alignment;
-  SpellBuff pPartyBuffs[20];
-  Player pPlayers[4];
-  NPCData pHirelings[2];
+  std::array<SpellBuff, 20> pPartyBuffs;
+  std::array<Player, 4> pPlayers;
+  std::array<NPCData, 2> pHirelings;
   ItemGen pPickedItem;
   unsigned int uFlags;
-  ItemGen StandartItemsInShops[53][12];
-  ItemGen SpecialItemsInShops[53][12];   //D0EC
-  ItemGen SpellBooksInGuilds[32][12];
-  char field_1605C[24];
+  std::array<std::array<ItemGen, 12>, 53> StandartItemsInShops;
+  std::array<std::array<ItemGen, 12>, 53> SpecialItemsInShops;   //D0EC
+  std::array<std::array<ItemGen, 12>, 32> SpellBooksInGuilds;
+  std::array<char, 24> field_1605C;
   char pHireling1Name[100];
   char pHireling2Name[100];
   int armageddon_timer;
   int field_16140;
-  int pTurnBasedPlayerRecoveryTimes[4];
-  int InTheShopFlags[53];
+  std::array<int, 4> pTurnBasedPlayerRecoveryTimes;
+  std::array<int, 53> InTheShopFlags;
   int uFine;
   float flt_TorchlightColorR;
   float flt_TorchlightColorG;