private void readJson(JToken node, ReadingOptions options)
        {
            X        = node.Value <float>("x");
            Y        = node.Value <float>("y");
            Z        = node.Value <float>("z");
            UnkByte  = node.Value <byte>("unkByte");
            UnkFloat = node.Value <float>("unkFloat");

            ZoneVolumes.Clear();
            JArray zones = node.Value <JArray>("zones");

            if (zones != null && zones.Type != JTokenType.Null)
            {
                foreach (JToken zone in zones)
                {
                    ZoneVolumes.Add(ArkName.From(zone.Value <string>()));
                }
            }

            Objects.Clear();
            ObjectMap.Clear();
            JArray objectsNode = node.Value <JArray>("objects");

            if (objectsNode != null && objectsNode.Type != JTokenType.Null)
            {
                foreach (var jsonNode in objectsNode)
                {
                    addObject(new GameObject((JObject)jsonNode, options.HibernationObjectProperties), options.BuildComponentTree);
                }
            }

            UnkInt1    = node.Value <int>("unkInt1");
            ClassIndex = node.Value <int>("classIndex");
        }
Ejemplo n.º 2
0
        public void ReadBinary(ArkArchive archive, ReadingOptions options)
        {
            TribeVersion = archive.ReadInt();

            if (TribeVersion != 1)
            {
                throw new NotSupportedException("Unknown Tribe Version " + TribeVersion);
            }

            int tribesCount = archive.ReadInt();

            Objects.Clear();
            ObjectMap.Clear();
            for (int i = 0; i < tribesCount; i++)
            {
                addObject(new GameObject(archive), options.BuildComponentTree);
            }

            for (int i = 0; i < tribesCount; i++)
            {
                GameObject gameObject = Objects[i];
                if (gameObject.ClassString == "PrimalTribeData")
                {
                    Tribe = gameObject;
                }

                gameObject.LoadProperties(archive, i < tribesCount - 1 ? Objects[i + 1] : null, 0);
            }
        }
Ejemplo n.º 3
0
        public void ReadBinary(ArkArchive archive, ReadingOptions options)
        {
            int objectCount = archive.ReadInt();

            Objects.Clear();
            ObjectMap.Clear();
            for (int i = 0; i < objectCount; i++)
            {
                addObject(new GameObject(archive), options.BuildComponentTree);
            }

            for (int i = 0; i < objectCount; i++)
            {
                Objects[i].LoadProperties(archive, i < objectCount - 1 ? Objects[i + 1] : null, 0);
            }
        }
Ejemplo n.º 4
0
        private void readBinaryObjects(ArkArchive archive, ReadingOptions options)
        {
            if (options.GameObjects)
            {
                int count = archive.ReadInt();

                Objects.Clear();
                ObjectMap.Clear();
                for (int n = 0; n < count; n++)
                {
                    addObject(new GameObject(archive), options.BuildComponentTree);
                }
            }
            else
            {
                archive.HasUnknownData  = true;
                archive.HasUnknownNames = true;
            }
        }
Ejemplo n.º 5
0
        private void readJsonObjects(JToken node, ReadingOptions options)
        {
            Objects.Clear();
            ObjectMap.Clear();
            if (!options.GameObjects)
            {
                return;
            }
            JArray objectsArray = node.Value <JArray>("objects");

            if (objectsArray == null)
            {
                return;
            }
            Objects.Capacity = objectsArray.Count;
            foreach (JObject jObject in objectsArray.Values <JObject>())
            {
                addObject(new GameObject(jObject, options.GameObjectProperties), options.BuildComponentTree);
            }
        }
        private void readBinaryObjects(ArkArchive archive, ReadingOptions options)
        {
            int count = archive.ReadInt();

            Objects.Clear();
            Objects.Capacity = count;
            ObjectMap.Clear();
            for (int index = 0; index < count; index++)
            {
                addObject(new GameObject(archive), options.BuildComponentTree);
            }

            if (nameTable == null)
            {
                return;
            }
            archive.SetNameTable(nameTable, 0, true);

            for (int index = 0; index < count; index++)
            {
                Objects[index].LoadProperties(archive, index + 1 < count ? Objects[index + 1] : null, 0);
            }
        }
Ejemplo n.º 7
0
 public void ReadJson(JToken node, ReadingOptions options)
 {
     Objects.Clear();
     ObjectMap.Clear();
     if (node.Type == JTokenType.Array)
     {
         foreach (JToken jsonObject in node)
         {
             addObject(new GameObject((JObject)jsonObject), options.BuildComponentTree);
         }
     }
     else
     {
         var objectsNode = node["objects"];
         if (objectsNode != null && objectsNode.Type != JTokenType.Null)
         {
             foreach (JToken jsonObject in objectsNode)
             {
                 addObject(new GameObject((JObject)jsonObject), options.BuildComponentTree);
             }
         }
     }
 }
Ejemplo n.º 8
0
        public void ReadJson(JToken node, ReadingOptions options)
        {
            TribeVersion = node.Value <int>("tribeVersion");

            Objects.Clear();
            ObjectMap.Clear();
            JObject tribeNode = node.Value <JObject>("tribe");

            if (tribeNode != null)
            {
                addObject(new GameObject(tribeNode), options.BuildComponentTree);
                Tribe = Objects[0];
            }

            JArray objectsNode = node.Value <JArray>("objects");

            if (objectsNode != null)
            {
                foreach (JToken objectNode in objectsNode)
                {
                    addObject(new GameObject((JObject)objectNode), options.BuildComponentTree);
                }
            }
        }
Ejemplo n.º 9
0
 public void Clear()
 {
     _map.Clear();
 }
Ejemplo n.º 10
0
 public void Clear()
 {
     _mapBundle.Clear();
 }