Example #1
0
 public void Update(MouseState mouse, MouseState oldMouse, string savePath, Object input)
 {
     keyboard = Keyboard.GetState();
     save.Update(mouse, oldMouse);
     cancel.Update(mouse, oldMouse);
     write.Update(keyboard, oldKeyboard);
     saveName = write.GetText();
     if (save.pressed == true && saveName != "")
     {
         FileStream fileStream = null;
         try
         {
             fileStream = new FileStream(savePath + "//" + saveName, FileMode.Create);
             BinaryFormatter b = new BinaryFormatter();
             b.Serialize(fileStream, input);
             cancel.pressed = true;
         }
         finally
         {
             if (fileStream != null)
             {
                 fileStream.Close();
             }
         }
     }
     oldKeyboard = keyboard;
 }
Example #2
0
 public void Update(MouseState mouse, MouseState oldMouse, Regiment regiment, string unitType)
 {
     keyboard = Keyboard.GetState();
     name.Update(mouse, oldMouse);
     cancel.Update(mouse, oldMouse);
     write.Update(keyboard, oldkeyboard);
     nametxt     = write.GetText();
     oldkeyboard = keyboard;
 }