This commit is contained in:
Yorick Rommers
2016-01-19 15:33:35 +01:00
27 changed files with 465 additions and 15 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 240 KiB

+1 -1
View File
@@ -117,7 +117,7 @@
</StackPanel>
<StackPanel Style="{StaticResource GameInfoPanel}" HorizontalAlignment="Stretch">
<Button Content="Back to Game" Tapped="BackToGame_Tapped" Style="{StaticResource Green}"/>
<Button Content="Back to Game" Click="BackToGame_Click" Style="{StaticResource Green}"/>
</StackPanel>
</StackPanel>
+7 -2
View File
@@ -121,7 +121,11 @@ namespace YJMPD_UWP
NavView.IsPaneOpen = false;
if (NavListHome.IsSelected)
{
if (Frame.BackStack.Count >= 1)
Frame.BackStack.Clear();
Frame.Navigate(typeof(MatchView));
}
else
if (NavListStatistics.IsSelected)
Frame.Navigate(typeof(StatisticsView));
@@ -138,9 +142,10 @@ namespace YJMPD_UWP
NavView.IsPaneOpen = false;
}
private async void BackToGame_Tapped(object sender, TappedRoutedEventArgs e)
private void BackToGame_Click(object sender, RoutedEventArgs e)
{
bool b = await Util.ShowConfirmDialog("Not implemented", "", Util.DialogType.OKCANCEL);
NavView.IsPaneOpen = false;
App.Game.BackToGame();
}
private void Content_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
+24
View File
@@ -6,6 +6,7 @@ using Windows.Foundation;
using YJMPD_UWP.Helpers;
using YJMPD_UWP.Helpers.EventArgs;
using YJMPD_UWP.Model.Object;
using YJMPD_UWP.Views;
namespace YJMPD_UWP.Model
{
@@ -126,5 +127,28 @@ namespace YJMPD_UWP.Model
UpdateGameStatus(GameStatus.STOPPED);
return true;
}
public void BackToGame()
{
switch(Status)
{
default:
case GameStatus.STOPPED:
break;
case GameStatus.SEARCHING:
App.Navigate(typeof(MatchView));
break;
case GameStatus.WAITING:
App.Navigate(typeof(WaitingView));
break;
case GameStatus.STARTED:
App.Navigate(typeof(GameView));
break;
case GameStatus.ENDED:
App.Navigate(typeof(ScoreView));
break;
}
}
}
}
+13 -1
View File
@@ -5,9 +5,16 @@
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="14" />
<Setter Property="TextWrapping" Value="WrapWholeWords" />
</Style>
<Style TargetType="StackPanel" x:Key="Base">
<Style TargetType="StackPanel" x:Key="BaseStackPanel">
<Setter Property="Margin" Value="10" />
</Style>
<Style TargetType="RelativePanel" x:Key="BaseRelativePanel">
<Setter Property="Margin" Value="10" />
</Style>
<Style TargetType="Grid" x:Key="BaseGrid">
<Setter Property="Margin" Value="10" />
</Style>
@@ -22,6 +29,11 @@
<Setter Property="FontSize" Value="14" />
</Style>
<Style TargetType="TextBlock" x:Key="Icon">
<Setter Property="FontFamily" Value="Segoe MDL2 Assets" />
<Setter Property="FontSize" Value="14" />
</Style>
<Style TargetType="Button" x:Key="Green">
<Setter Property="Background" Value="DarkGreen" />
<Setter Property="Foreground" Value="White" />
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YJMPD_UWP.ViewModels
{
public class GameVM : TemplateVM
{
public GameVM() : base("Game")
{
}
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YJMPD_UWP.ViewModels
{
public class PhotoVM : TemplateVM
{
public PhotoVM() : base("Photo")
{
}
}
}
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YJMPD_UWP.Model.Object;
namespace YJMPD_UWP.ViewModels
{
public class ScoreVM : TemplateVM
{
private List<Player> players;
public ScoreVM() : base("Scores")
{
this.players = App.Game.Players.OrderBy(p => p.Points).ToList();
App.Game.OnPlayersUpdate += Game_OnPlayersUpdate;
}
private void Game_OnPlayersUpdate(object sender, Helpers.EventArgs.GamePlayersUpdatedEventArgs e)
{
dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
this.players = App.Game.Players.OrderBy(p => p.Points).ToList();
NotifyPropertyChanged(nameof(Players));
NotifyPropertyChanged(nameof(PlayersCount));
});
}
public List<Player> Players
{
get
{
return new List<Player>(players);
}
}
public string PlayersCount
{
get
{
return "There are currently " + App.Game.Players.Count + " players in the match.";
}
}
}
}
+8
View File
@@ -20,5 +20,13 @@ namespace YJMPD_UWP.ViewModels
Settings.Username = value;
}
}
public bool UsernameEnabled
{
get
{
return App.Game.Status == Model.GameHandler.GameStatus.STOPPED;
}
}
}
}
+36 -1
View File
@@ -8,8 +8,43 @@
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Style="{StaticResource Base}" >
<StackPanel Style="{StaticResource BaseStackPanel}" >
<StackPanel>
<TextBlock Style="{StaticResource Header}" Text="About this app" />
<TextBlock>
This application was developed as a school project for Avans Hogeschool.
</TextBlock>
</StackPanel>
<StackPanel Margin="0,10,0,0">
<TextBlock Style="{StaticResource Header}" Text="About the creators" />
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource Subtext}" Grid.Row="0" Grid.Column="0" Text="Yorick Rommers" />
<TextBlock Style="{StaticResource Subtext}" Grid.Row="1" Grid.Column="0" Text="Kenneth van Ewijk" />
<TextBlock Style="{StaticResource Subtext}" Grid.Row="2" Grid.Column="0" Text="Janco Kock" />
<Button Name="YorickGit" Click="YorickGit_Click" Grid.Row="0" Content="Github" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,0,0,5" />
<Button Name="KennethGit" Click="KennethGit_Click" Grid.Row="1" Content="Github" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,0,0,5"/>
<Button Name="JancoGit" Click="JancoGit_Click" Grid.Row="2" Content="Github" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,0,0,5"/>
<Button Name="YorickSite" Click="YorickSite_Click" Grid.Row="0" Content="Website" Grid.Column="2" HorizontalAlignment="Stretch" Margin="5,0,0,5"/>
<Button Name="KennethSite" Click="KennethSite_Click" Grid.Row="1" Content="Website" Grid.Column="2" HorizontalAlignment="Stretch" Margin="5,0,0,5"/>
<Button Name="JancoSite" Click="JancoSite_Click" Grid.Row="2" Content="Website" Grid.Column="2" HorizontalAlignment="Stretch" Margin="5,0,0,5"/>
</Grid>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Page>
+28 -1
View File
@@ -1,4 +1,5 @@
using YJMPD_UWP.ViewModels;
using System;
using YJMPD_UWP.ViewModels;
using Windows.UI.Xaml.Controls;
namespace YJMPD_UWP.Views
@@ -13,5 +14,31 @@ namespace YJMPD_UWP.Views
this.DataContext = aboutvm;
this.InitializeComponent();
}
private void YorickGit_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
Windows.System.Launcher.LaunchUriAsync(new Uri("http://github.com/yorickr"));
}
private void KennethGit_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
Windows.System.Launcher.LaunchUriAsync(new Uri("http://github.com/kennyboy55"));
}
private void JancoGit_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
Windows.System.Launcher.LaunchUriAsync(new Uri("http://github.com/jancoow"));
}
private void YorickSite_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
Windows.System.Launcher.LaunchUriAsync(new Uri("https://imegumii.space"));
}
private void KennethSite_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
Windows.System.Launcher.LaunchUriAsync(new Uri("http://kvewijk.nl"));
}
private void JancoSite_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
Windows.System.Launcher.LaunchUriAsync(new Uri("https://jancokock.me"));
}
}
}
+15
View File
@@ -0,0 +1,15 @@
<Page
x:Class="YJMPD_UWP.Views.GameView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:YJMPD_UWP.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Style="{StaticResource BaseStackPanel}">
</StackPanel>
</ScrollViewer>
</Page>
+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using YJMPD_UWP.ViewModels;
namespace YJMPD_UWP.Views
{
public sealed partial class GameView : Page
{
GameVM gamevm;
public GameView()
{
gamevm = new GameVM();
this.DataContext = gamevm;
this.InitializeComponent();
}
}
}
+3 -3
View File
@@ -13,11 +13,11 @@
</Page.Resources>
<ScrollViewer>
<StackPanel Style="{StaticResource Base}" >
<StackPanel Style="{StaticResource BaseStackPanel}" >
<StackPanel>
<TextBlock Text="Start a match" Style="{StaticResource Header}" />
<Button Content="Start match" Style="{StaticResource Green}" Tapped="StartMatchButton_Tapped" IsEnabled="{Binding MatchAvailable}" Visibility="{Binding StartMatch, Converter={StaticResource BoolToVisConverter}}" />
<Button Content="Leave match" Style="{StaticResource Red}" Tapped="StopMatchButton_Tapped" Visibility="{Binding StopMatch, Converter={StaticResource BoolToVisConverter}}" />
<Button Content="Start match" Style="{StaticResource Green}" Click="StartMatchButton_Click" IsEnabled="{Binding MatchAvailable}" Visibility="{Binding StartMatch, Converter={StaticResource BoolToVisConverter}}" />
<Button Content="Leave match" Style="{StaticResource Red}" Click="StopMatchButton_Click" Visibility="{Binding StopMatch, Converter={StaticResource BoolToVisConverter}}" />
</StackPanel>
<StackPanel Visibility="{Binding StopMatch, Converter={StaticResource BoolToVisConverter}}" Margin="0,10,0,0">
+4 -3
View File
@@ -1,4 +1,5 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using YJMPD_UWP.ViewModels;
namespace YJMPD_UWP.Views
@@ -14,12 +15,12 @@ namespace YJMPD_UWP.Views
this.InitializeComponent();
}
private void StartMatchButton_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
private void StartMatchButton_Click(object sender, RoutedEventArgs e)
{
App.Game.Start();
}
private void StopMatchButton_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
private void StopMatchButton_Click(object sender, RoutedEventArgs e)
{
App.Game.Stop();
}
+15
View File
@@ -0,0 +1,15 @@
<Page
x:Class="YJMPD_UWP.Views.PhotoView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:YJMPD_UWP.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Style="{StaticResource BaseStackPanel}">
</StackPanel>
</ScrollViewer>
</Page>
+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using YJMPD_UWP.ViewModels;
namespace YJMPD_UWP.Views
{
public sealed partial class PhotoView : Page
{
PhotoVM photovm;
public PhotoView()
{
photovm = new PhotoVM();
this.DataContext = photovm;
this.InitializeComponent();
}
}
}
+47
View File
@@ -0,0 +1,47 @@
<Page
x:Class="YJMPD_UWP.Views.ScoreView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:YJMPD_UWP.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ScrollViewer>
<Grid Style="{StaticResource BaseGrid}" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Margin="0,10,0,0" Grid.Row="0">
<TextBlock Text="Players" Style="{StaticResource Header}" />
<TextBlock Text="{Binding PlayersCount}" />
</StackPanel>
<ListView x:Name="PlayersList" ItemsSource="{Binding Players}" SelectionMode="None" Grid.Row="1" IsTapEnabled="False">
<ListView.ItemTemplate>
<DataTemplate x:Name="ListViewDataTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Username}" Margin="0,0,5,0" />
<TextBlock Text="{Binding Points}" Margin="0,0,5,0" />
<TextBlock Text="{Binding PointsTotal}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackPanel Grid.Row="2">
<Button Style="{StaticResource Green}" Name="ReadyButton" Click="ReadyButton_Click">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Icon}" Text="&#xE8FB;" Visibility="Collapsed" Name="ReadyCheck" Margin="0,0,10,0" />
<TextBlock Text="Ready" />
</StackPanel>
</Button>
</StackPanel>
</Grid>
</ScrollViewer>
</Page>
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using YJMPD_UWP.ViewModels;
namespace YJMPD_UWP.Views
{
public sealed partial class ScoreView : Page
{
ScoreVM scorevm;
public ScoreView()
{
scorevm = new ScoreVM();
this.DataContext = scorevm;
this.InitializeComponent();
}
private void ReadyButton_Click(object sender, RoutedEventArgs e)
{
Ready();
}
private async void Ready()
{
ReadyCheck.Visibility = Visibility.Visible;
ReadyButton.IsEnabled = false;
Task.Delay(TimeSpan.FromMilliseconds(1500));
App.Navigate(typeof(WaitingView));
}
}
}
+2 -2
View File
@@ -8,10 +8,10 @@
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Style="{StaticResource Base}" >
<StackPanel Style="{StaticResource BaseStackPanel}" >
<StackPanel>
<TextBlock Text="Username" Style="{StaticResource Header}" />
<TextBox Text="{Binding Username, Mode=TwoWay}" />
<TextBox Text="{Binding Username, Mode=TwoWay}" IsEnabled="{Binding UsernameEnabled}"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
+1 -1
View File
@@ -8,7 +8,7 @@
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Style="{StaticResource Base}" >
<StackPanel Style="{StaticResource BaseStackPanel}" >
<StackPanel Margin="0,10,0,0">
<TextBlock Text="{Binding Information}" Style="{StaticResource Subtext}" />
+16
View File
@@ -0,0 +1,16 @@
<Page
x:Class="YJMPD_UWP.Views.WaitingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:YJMPD_UWP.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<RelativePanel Style="{StaticResource BaseRelativePanel}">
<StackPanel RelativePanel.AlignHorizontalCenterWithPanel="True" RelativePanel.AlignVerticalCenterWithPanel="True" Margin="0,-50,0,0">
<ProgressRing Width="80" Height="80" HorizontalAlignment="Center" IsActive="True" />
<TextBlock Text="Waiting on other players..." FontSize="20" Margin="0,20,0,0"/>
</StackPanel>
</RelativePanel>
</Page>
+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace YJMPD_UWP.Views
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class WaitingView : Page
{
public WaitingView()
{
this.InitializeComponent();
}
}
}
+31
View File
@@ -117,23 +117,38 @@
<Compile Include="Model\PhotoHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\AboutVM.cs" />
<Compile Include="ViewModels\GameVM.cs" />
<Compile Include="ViewModels\MainPageVM.cs" />
<Compile Include="ViewModels\MatchVM.cs" />
<Compile Include="ViewModels\PhotoVM.cs" />
<Compile Include="ViewModels\ScoreVM.cs" />
<Compile Include="ViewModels\SettingsVM.cs" />
<Compile Include="ViewModels\StatisticsVM.cs" />
<Compile Include="ViewModels\TemplateVM.cs" />
<Compile Include="Views\AboutView.xaml.cs">
<DependentUpon>AboutView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GameView.xaml.cs">
<DependentUpon>GameView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\MatchView.xaml.cs">
<DependentUpon>MatchView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\PhotoView.xaml.cs">
<DependentUpon>PhotoView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ScoreView.xaml.cs">
<DependentUpon>ScoreView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\SettingsView.xaml.cs">
<DependentUpon>SettingsView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\StatisticsView.xaml.cs">
<DependentUpon>StatisticsView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\WaitingView.xaml.cs">
<DependentUpon>WaitingView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
@@ -179,10 +194,22 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\GameView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MatchView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\PhotoView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ScoreView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\SettingsView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -191,6 +218,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\WaitingView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="Helpers\Comparer\" />