Beispiel #1
0
        public void ReadFromFile(BinaryReader reader)
        {
            unk0 = reader.ReadUInt32();
            uint count0 = reader.ReadUInt32();
            uint count1 = reader.ReadUInt32();

            vehicles = new IVehicleTableItem[count0];

            for (int i = 0; i < count1; i++)
            {
                IVehicleTableItem Item = null;
                if (gameVersion == GamesEnumerator.MafiaIII)
                {
                    Item = new VehicleTableItem_M3();
                }
                else if (gameVersion == GamesEnumerator.MafiaI_DE)
                {
                    Item = new VehicleTableItem_M1();
                }
                else
                {
                    MessageBox.Show("Toolkit", "Should have got the correct VehicleTableItem type.");
                }

                Item.ReadEntry(reader);

                vehicles[i] = Item;
            }
        }
Beispiel #2
0
        public void SetFromTreeNodes(TreeNode Root)
        {
            Vehicles = new IVehicleTableItem[Root.Nodes.Count];

            for (int i = 0; i < Vehicles.Length; i++)
            {
                TreeNode          ChildNode = Root.Nodes[i];
                IVehicleTableItem Entry     = (IVehicleTableItem)ChildNode.Tag;
                Vehicles[i] = Entry;
            }
        }