Server.Items.HousePlacementEntry.FillTable C# (CSharp) Method

FillTable() private static method

private static FillTable ( HousePlacementEntry entries ) : void
entries HousePlacementEntry
return void
        private static void FillTable( HousePlacementEntry[] entries )
        {
            for ( int i = 0; i < entries.Length; ++i )
            {
                HousePlacementEntry e = entries[i];

                object obj = m_Table[e.m_Type];

                if ( obj == null )
                {
                    m_Table[e.m_Type] = e;
                }
                else if ( obj is HousePlacementEntry )
                {
                    ArrayList list = new ArrayList();

                    list.Add( obj );
                    list.Add( e );

                    m_Table[e.m_Type] = list;
                }
                else if ( obj is ArrayList )
                {
                    ArrayList list = (ArrayList)obj;

                    if ( list.Count == 8 )
                    {
                        Hashtable table = new Hashtable();

                        for ( int j = 0; j < list.Count; ++j )
                            table[((HousePlacementEntry)list[j]).m_MultiID] = list[j];

                        table[e.m_MultiID] = e;

                        m_Table[e.m_Type] = table;
                    }
                    else
                    {
                        list.Add( e );
                    }
                }
                else if ( obj is Hashtable )
                {
                    ((Hashtable)obj)[e.m_MultiID] = e;
                }
            }
        }