Exemple #1
0
        public void InitYmapEntityArchetypes(GameFileCache gfc)
        {
            if (Owner == null)
            {
                return;
            }
            var arch = Owner.Archetype;

            if (Entities != null)
            {
                for (int j = 0; j < Entities.Length; j++)
                {
                    var ient  = Entities[j];
                    var iarch = gfc.GetArchetype(ient._CEntityDef.archetypeName);
                    ient.SetArchetype(iarch);

                    if (iarch == null)
                    {
                    }   //can't find archetype - des stuff eg {des_prologue_door}
                }

                UpdateBBs(arch);
            }

            if (EntitySets != null)
            {
                for (int e = 0; e < EntitySets.Length; e++)
                {
                    var entitySet = EntitySets[e];
                    var entities  = entitySet.Entities;
                    if (entities == null)
                    {
                        continue;
                    }

                    for (int i = 0; i < entities.Count; i++)
                    {
                        var ient  = entities[i];
                        var iarch = gfc.GetArchetype(ient._CEntityDef.archetypeName);
                        ient.SetArchetype(iarch);

                        if (iarch == null)
                        {
                        }   //can't find archetype - des stuff eg {des_prologue_door}
                    }
                }
            }
        }
Exemple #2
0
        private void InitProp(CutPropModelObject prop, GameFileCache gfc)
        {
            Prop = new YmapEntityDef();
            Prop.SetArchetype(gfc.GetArchetype(prop.StreamingName));

            AnimHash = prop.StreamingName;
        }
Exemple #3
0
        private Archetype TryGetArchetype(uint hash)
        {
            if ((gameFileCache == null) || (!gameFileCache.IsInited))
            {
                return(null);
            }

            var arch = gameFileCache.GetArchetype(hash);

            if ((arch != null) && (arch != currentArchetype) && (updateArchetypeStatus))
            {
                UpdateStatus("Archetype: " + arch.Name.ToString());
                currentArchetype      = arch;
                updateArchetypeStatus = false;
            }

            return(arch);
        }