예제 #1
0
        public GameScreen(Control MainControl, int MapIndex, int SavegameIndex, GameControl.MultiplayerMatchStartInformation MPInfo)
        {
            InitializeComponent(); // load GameScreen.xaml
            this.Resources.MergedDictionaries.Add(R.GetLanguageDictionary()); // load dictionary resource

            this.MainControl = MainControl;
            this.GameControl = new GameControl(MainControl, this, MapIndex, SavegameIndex, MPInfo); // bi-directional association between control and gui

            if (GameControl.Game == null) // problems initializing the game object
                return;

            if (GameControl.Game.Map == null) // something went wront
            {
                MainControl.ShowMenuScreen();
            }

            // initialize gui (hide stuff, etc.)
            HideRecruitmentMenu();

            RefreshMap(GameControl.Game.Map);
            RefreshMoneyAndFractionOnTheMove();

            Label_Info_Name.Content = null;
            Label_Info_Type.Content = null;
            Label_AttackBonus.Content = null;
            Label_DefenseBonus.Content = null;
            Image_AttackBonus.Visibility = Visibility.Hidden;
            Image_DefenseBonus.Visibility = Visibility.Hidden;

            // sound
            Sound.PlaySound(Sound.SoundName.GameBackground);
        }
예제 #2
0
파일: Control.cs 프로젝트: Simsso/Crusades
 // shows the game screen
 public void ShowGameScreen(int MapIndex, int SavegameIndex, GameControl.MultiplayerMatchStartInformation MPInfo = null)
 {
     QuitCurrentScreen();
     GameScreen = new GameScreen(this, MapIndex, SavegameIndex, MPInfo);
     MainWindow.ContentControl_Main.Content = GameScreen;
 }
예제 #3
0
파일: Data.cs 프로젝트: Simsso/Crusades
 public static void SaveMultiplayerGameState(string Name, GameControl.MultiplayerGameState GameState)
 {
     CreateDirectory();
     string UncompressedFilePath = SerializeObject(GameState, Name, DataPath + "\\" + MultiplayerPath);
     Compression.CompressFile(UncompressedFilePath, DataPath + "\\" + MultiplayerPath + "\\" + Name + DefaultCompressedFileExtension);
     File.Delete(UncompressedFilePath);
 }