public FactionMember( Faction parent, MyObjectBuilder_FactionMember definition )
 {
     m_parent = parent;
     m_member = definition;
 }
        protected void RefreshFactions( )
        {
            List<MyObjectBuilder_Faction> factionList = GetSubTypeEntity( ).Factions;

            //Cleanup missing factions
            List<Faction> factionsToRemove = new List<Faction>( );
            foreach ( Faction faction in m_factions.Values )
            {
                bool foundMatch = false;
                foreach ( MyObjectBuilder_Faction entry in factionList )
                {
                    if ( entry.FactionId == faction.Id )
                    {
                        foundMatch = true;
                        break;
                    }
                }
                if ( foundMatch )
                    continue;

                factionsToRemove.Add( faction );
            }
            foreach ( Faction faction in factionsToRemove )
            {
                m_factions.Remove( faction.Id );
            }

            //Add new factions
            foreach ( MyObjectBuilder_Faction faction in factionList )
            {
                if ( m_factions.ContainsKey( faction.FactionId ) )
                    continue;

                Faction newFaction = new Faction( faction );
                m_factions.Add( newFaction.Id, newFaction );
            }
        }
        protected void RefreshFactions()
        {
            List<MyObjectBuilder_Faction> factionList = GetSubTypeEntity().Factions;

            //Cleanup missing factions
            List<Faction> factionsToRemove = new List<Faction>();
            foreach (Faction faction in m_factions.Values)
            {
                if (factionList.Contains(faction.BaseEntity))
                    continue;

                factionsToRemove.Add(faction);
            }
            foreach (Faction faction in factionsToRemove)
            {
                m_factions.Remove(faction.Id);
            }

            //Add new factions
            foreach (MyObjectBuilder_Faction faction in factionList)
            {
                if (m_factions.ContainsKey(faction.FactionId))
                    continue;

                Faction newFaction = new Faction(faction);
                m_factions.Add(newFaction.Id, newFaction);
            }
        }