// Define Mobile class class Mobile { MobileAbstractNode m_head; int filenum = 3; int curfile = -1; String [] filename= new String[filenum]; Mobile() { m_head = new MobileThreadNode(); m_head.SetPos(0, -390, 0); filename[0] = "1.mob"; filename[1] = "2.mob";filename[2] = "3.mob"; } void Draw() { m_head.Draw(); } void ShowMenu() { m_head.ShowMenu(); } boolean Select() { m_head.Unselect(); return m_head.Select(0, 0, 0); } boolean IsSelected() { return m_head.IsSelected(); } boolean Drag() { return m_head.Drag(); } boolean PressKey() { return m_head.PressKey(); } void Rotate(pt ptOrigin, float angleX, float angleY, float angleZ) { m_head.Rotate(ptOrigin, angleX, angleY, angleZ); } void Save() { String [] buffer = new String [1000]; int s=0; s = m_head.Save(buffer, s); String [] bufferFile = new String[s]; for ( int i = 0; i < s; i++ ) { bufferFile[i] = buffer[i]; } saveStrings("\\data\\mobile.mob",bufferFile); } void Load() { curfile++; println("Load"); String[] buffer = loadStrings(filename[curfile%filenum]); for ( int i = 0; i < buffer.length; i++ ) { println(buffer[i]); } int s = 1; m_head.Load(buffer, s); } void Reset() { m_head = new MobileThreadNode(); m_head.SetPos(0, -390, 0); } }