|
@@ -4,6 +4,7 @@ using System.IO;
|
|
|
using System.Media;
|
|
|
using Avalonia;
|
|
|
using Avalonia.Controls;
|
|
|
+using Avalonia.Controls.Shapes;
|
|
|
using Avalonia.Media;
|
|
|
using ExCSS;
|
|
|
using HelloItQuantum.Function;
|
|
@@ -14,11 +15,11 @@ namespace HelloItQuantum.ViewModels
|
|
|
{
|
|
|
public class LabyrinthViewModel : MainWindowViewModel
|
|
|
{
|
|
|
-
|
|
|
+ List<string> listContent = new List<string>();
|
|
|
bool isVisibleContextWindow = true;
|
|
|
string textInSP = "Æèë-áûë ðîáîò Ðàêåòà. Îí õîòåë ïîìî÷ü ïðîôåññîðó íà ñòàíöèè, íî ìåæäó íèìè áûë ëàáèðèíò èç îðàíæåâûõ è êðàñíûõ êëåòîê. Ðàêåòà ìîã èäòè òîëüêî ïî îðàíæåâûì, èçáåãàÿ êðàñíûõ. Ïîìîãè Ðàêåòå äîáðàòüñÿ äî ñòàíöèè ïðîôåññîðà.";
|
|
|
string textInBTN = "Äàëåå";
|
|
|
-
|
|
|
+ string pathAudio = $"LabyrinthAudio\\voice_start.wav";
|
|
|
|
|
|
StackPanel listCommandForRobots = new StackPanel();
|
|
|
public StackPanel ListCommandForRobots { get => listCommandForRobots; set => SetProperty(ref listCommandForRobots, value); }
|
|
@@ -26,18 +27,29 @@ namespace HelloItQuantum.ViewModels
|
|
|
public string TextInSP { get => textInSP; set => SetProperty(ref textInSP, value); }
|
|
|
public string TextInBTN { get => textInBTN; set => SetProperty(ref textInBTN, value); }
|
|
|
|
|
|
- List<string> listContent = new List<string>();
|
|
|
-
|
|
|
- public void GoNext() {
|
|
|
- TextInSP = "Çäîðîâî! Ðàêåòà îêàçàëñÿ íà èññëåäîâàòåëüñêîé ñòàíöèè è ïîìîã ïðîôåññîðó ïî÷èíèòü ëàáîðàòîðèþ. Ìèññèÿ âûïîëíåíà!";
|
|
|
+ /// <summary>
|
|
|
+ /// Ôóíêöèÿ çàïóñêà àóäèî
|
|
|
+ /// </summary>
|
|
|
+ public void PlayTask()
|
|
|
+ {
|
|
|
+ SoundPlayer snd = new SoundPlayer(pathAudio);
|
|
|
+ snd.Play();
|
|
|
+ }
|
|
|
+ public void GoNext()
|
|
|
+ {
|
|
|
IsVisibleContextWindow = false;
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// Âåðíóòüñÿ â ãëàâíîå ìåíþ
|
|
|
+ /// </summary>
|
|
|
public void GoBack()
|
|
|
{
|
|
|
PageSwitch.View = new PlaySectionView();
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// Äîáàâëåíèå ñïèñêà êîìàíä ïðè íàæàòèè íà êíîïêó
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="comand">ïåðåäàâàåìàÿ êîìàíäà (âëåâî, âïðàâî, âíèç, ââåðõ)</param>
|
|
|
public void AddButton(string comand)
|
|
|
{
|
|
|
ListCommandForRobots.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center;
|
|
@@ -54,13 +66,17 @@ namespace HelloItQuantum.ViewModels
|
|
|
border.Margin = new Thickness(5);
|
|
|
ListCommandForRobots.Children.Add(border);
|
|
|
listContent.Add(tb.Text);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// Î÷èùåíèå ñïèñêà êîìàíä äëÿ ðîáîòà
|
|
|
+ /// </summary>
|
|
|
public void DeleteCommand() {
|
|
|
ListCommandForRobots.Children.Clear();
|
|
|
listContent.Clear();
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// Ïðîâåðêà ïðàâèëüíîñòè ñïèñêà êîìàíä
|
|
|
+ /// </summary>
|
|
|
public void CheckCommand()
|
|
|
{
|
|
|
//ListCommandForRobots.Children.Clear();
|
|
@@ -112,6 +128,7 @@ namespace HelloItQuantum.ViewModels
|
|
|
if (googCommands)
|
|
|
{
|
|
|
WorkWithFile.UpdateValueGameProgress(2, 100, CurrentUser);
|
|
|
+ pathAudio = $"LabyrinthAudio\\voice_win.wav";
|
|
|
TextInSP = "Çäîðîâî! Ðàêåòà îêàçàëñÿ íà èññëåäîâàòåëüñêîé ñòàíöèè è ïîìîã ïðîôåññîðó ïî÷èíèòü ëàáîðàòîðèþ. Ìèññèÿ âûïîëíåíà!";
|
|
|
IsVisibleContextWindow = true;
|
|
|
TextInBTN = "Çàêðûòü";
|
|
@@ -119,15 +136,13 @@ namespace HelloItQuantum.ViewModels
|
|
|
else {
|
|
|
|
|
|
TextInSP = "Ê ñîæàëåíèþ, Ðàêåòà çàáëóäèëñÿ è íå äîáðàëñÿ äî èññëåäîâàòåëüñêîé ñòàíöèè. Íå îò÷àèâàéñÿ! Ïîïðîáóé çàíîâî!";
|
|
|
+ pathAudio = $"LabyrinthAudio\\voice_loss.wav";
|
|
|
IsVisibleContextWindow = true;
|
|
|
TextInBTN = "Çàêðûòü";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
- public class NameComand {
|
|
|
- public string name { get; set; }
|
|
|
- }
|
|
|
-
|
|
|
}
|