merge stuff

This commit is contained in:
Sem van der Hoeven
2020-10-22 22:35:29 +02:00
parent ec156f3dc6
commit 09f9e227b8
4 changed files with 14 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
using Client.Views;
using Client.Views;
using GalaSoft.MvvmLight.Command;
using SharedClientServer;
using System;
@@ -9,7 +9,6 @@ using System.ComponentModel;
using System.Diagnostics;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
@@ -33,12 +32,6 @@ namespace Client.ViewModels
private dynamic _payload;
public static string Word
{
get;
set;
}
public string _username;
public string _message;
@@ -54,6 +47,12 @@ namespace Client.ViewModels
}
}
public static string Word
{
get;
set;
}
public bool IsHost
{
get { return data.User.Host; }
@@ -213,10 +212,6 @@ namespace Client.ViewModels
data.Client.SendMessage(JSONConvert.GetMessageToSend(JSONConvert.MESSAGE, _payload));
}
/*
* MISC make this a callback
* Handles the incoming chat message from another client.
*/
public static void HandleIncomingMsg(string username, string message)
{
Application.Current.Dispatcher.Invoke(delegate
@@ -224,21 +219,20 @@ namespace Client.ViewModels
Messages.Add($"{username}: {message}");
});
}
public void LeaveGame(object sender, CancelEventArgs e)
public void LeaveGame(object sender, System.ComponentModel.CancelEventArgs e)
{
Debug.WriteLine("Leaving...");
data.Client.SendMessage(JSONConvert.ConstructLobbyLeaveMessage(data.Lobby.ID));
}
/*
* MISC make this a callback
* Handles the random word that has been received from the server.
*/
public static void HandleRandomWord(string randomWord)
{
Debug.WriteLine("[CLIENT] Reached the handle random word method!");
Word = "NegerPik";
Application.Current.Dispatcher.Invoke(delegate
{
Word = randomWord;
});
}
}
}