-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fully-functional local play, ported from [Azul-Java](https://github.com/Jsnhlbr5/Azul-Java) with tweaks. Lobby UI contains disabled elements for network play.
- Loading branch information
0 parents
commit a7ab615
Showing
45 changed files
with
3,015 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<StartupObject>AzulApp.Program</StartupObject> | ||
<ApplicationIcon>img\icon.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<Prefer32Bit>true</Prefer32Bit> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="img\BLACK.png" /> | ||
<None Remove="img\BLUE.png" /> | ||
<None Remove="img\factory.png" /> | ||
<None Remove="img\PlayerBoard.png" /> | ||
<None Remove="img\RED.png" /> | ||
<None Remove="img\resize_handle.png" /> | ||
<None Remove="img\score.png" /> | ||
<None Remove="img\TEAL.png" /> | ||
<None Remove="img\WHITE.png" /> | ||
<None Remove="img\YELLOW.png" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="img\BLACK.png" /> | ||
<EmbeddedResource Include="img\BLUE.png" /> | ||
<EmbeddedResource Include="img\factory.png" /> | ||
<EmbeddedResource Include="img\PlayerBoard.png" /> | ||
<EmbeddedResource Include="img\RED.png" /> | ||
<EmbeddedResource Include="img\resize_handle.png" /> | ||
<EmbeddedResource Include="img\score.png" /> | ||
<EmbeddedResource Include="img\TEAL.png" /> | ||
<EmbeddedResource Include="img\WHITE.png" /> | ||
<EmbeddedResource Include="img\YELLOW.png" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.1.3" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.3" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.3" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="Microsoft.AspNetCore"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Diagnostics"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Diagnostics.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Hosting"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Hosting.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Hosting.Abstractions.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Http.Abstractions"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Http.Abstractions.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Http.Connections.Common"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Http.Connections.Common.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Http.Features"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Http.Features.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.Routing"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.Routing.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.SignalR"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.SignalR.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.SignalR.Common"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.SignalR.Common.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.SignalR.Core"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.SignalR.Core.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.AspNetCore.SignalR.Protocols.Json"> | ||
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.1.3\ref\netcoreapp3.1\Microsoft.AspNetCore.SignalR.Protocols.Json.dll</HintPath> | ||
<Private>true</Private> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="Properties\Resources.Designer.cs"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Update="Properties\Resources.resx"> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30001.183 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzulApp", "AzulApp.csproj", "{2CDAF99D-D33B-4518-A73B-F0F4A7A79FED}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{63943181-1077-4597-B7E5-BF91EA809D7F}" | ||
ProjectSection(SolutionItems) = preProject | ||
.editorconfig = .editorconfig | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{2CDAF99D-D33B-4518-A73B-F0F4A7A79FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{2CDAF99D-D33B-4518-A73B-F0F4A7A79FED}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{2CDAF99D-D33B-4518-A73B-F0F4A7A79FED}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{2CDAF99D-D33B-4518-A73B-F0F4A7A79FED}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {88BBA2BA-2FDE-4567-A400-39829D153B04} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace AzulApp | ||
{ | ||
public enum Color | ||
{ | ||
BLUE, YELLOW, RED, BLACK, TEAL, WHITE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Drawing; | ||
using System.Windows.Forms; | ||
|
||
namespace AzulApp | ||
{ | ||
class Factory : Panel | ||
{ | ||
private readonly TileButton[] buttons; | ||
private readonly Game model; | ||
|
||
public int Index { get; } | ||
|
||
public Factory(Game m, int ndx) | ||
{ | ||
model = m; | ||
Index = ndx; | ||
SuspendLayout(); | ||
|
||
BackgroundImageLayout = ImageLayout.Zoom; | ||
BackgroundImage = Properties.Resources.factory; | ||
Name = "Factory" + Index; | ||
Size = new Size(240, 240); | ||
|
||
buttons = new TileButton[4]; | ||
|
||
for (int i = 0; i < 4; ++i) | ||
{ | ||
buttons[i] = new TileButton(); | ||
Controls.Add(buttons[i]); | ||
|
||
int x = (i % 2 == 0) ? FIRST_POSITION : SECOND_POSITION; | ||
int y = (i < 2) ? FIRST_POSITION : SECOND_POSITION; | ||
buttons[i].Location = new Point(x, y); | ||
|
||
buttons[i].Click += new EventHandler(model.PickTiles); | ||
} | ||
|
||
ResumeLayout(); | ||
} | ||
|
||
/** | ||
* Removes old tiles (if any) and creates new ones; updates buttons to match. | ||
*/ | ||
public void UpdateTiles() | ||
{ | ||
SuspendLayout(); | ||
// Disable buttons | ||
foreach (TileButton b in buttons) | ||
{ | ||
b.Enabled = false; | ||
b.TileColor = null; | ||
} | ||
|
||
// Get new tiles and enable buttons (as appropriate) | ||
TileCollection tc = model.getFactoryTiles(Index); | ||
for (int i = 0; i < tc.Count; ++i) | ||
{ | ||
buttons[i].TileColor = tc[i]; | ||
} | ||
ResumeLayout(); | ||
} | ||
|
||
private static readonly int FIRST_POSITION = 57, SECOND_POSITION = 123; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.