63 {
66 {
69 string type = entity.GetType();
70 if ( container.IsInherited( ContainerWithCargo ) )
71 {
72 if ( !serialized_types.Contains( type ) )
73 {
74 ContainerWithCargo item_with_cargo = ContainerWithCargo.Cast( container );
75 serialized_types.Insert( type, item_with_cargo.IsOpened() );
76 }
77 }
78 }
79
80 if ( serialized_types.Count() > 0 )
81 {
82 FileSerializer file = new FileSerializer();
83 if ( file.
Open(
"inventory_state.save",
FileMode.APPEND ) )
84 {
85 file.
Write( serialized_types.Count() );
86
87 for ( i = 0; i < serialized_types.Count(); i++ )
88 {
89 file.
Write( serialized_types.GetKey( i ) );
90 file.
Write( serialized_types.GetElement( i ) );
91 }
92 }
94 }
95 }
proto native bool Open(string path, FileMode mode=FileMode.READ)
proto native void Close()
proto bool Write(void value_out)
ref map< EntityAI, ref Container > m_ShowedItems