├── .gitattributes
├── .gitignore
├── .vsconfig
├── LICENSE.txt
├── NuGet.config
├── README.md
├── UnoTetris.sln
└── UnoTetris
├── UnoTetris.Base
├── AppHead.xaml
├── AppHead.xaml.cs
└── base.props
├── UnoTetris.Mobile
├── Android
│ ├── AndroidManifest.xml
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── Main.Android.cs
│ ├── MainActivity.Android.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── mipmap-hdpi
│ │ │ └── icon.png
│ │ ├── mipmap-ldpi
│ │ │ └── icon.png
│ │ ├── mipmap-mdpi
│ │ │ └── icon.png
│ │ ├── mipmap-tvdpi
│ │ │ └── icon.png
│ │ ├── mipmap-xhdpi
│ │ │ └── icon.png
│ │ ├── mipmap-xxhdpi
│ │ │ └── icon.png
│ │ ├── mipmap-xxxhdpi
│ │ │ └── icon.png
│ │ └── values
│ │ │ ├── Strings.xml
│ │ │ └── Styles.xml
│ └── environment.conf
├── MacCatalyst
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── LaunchScreen.storyboard
│ ├── Main.maccatalyst.cs
│ ├── Media.xcassets
│ │ └── AppIcons.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon1024.png
│ │ │ ├── Icon120.png
│ │ │ ├── Icon152.png
│ │ │ ├── Icon167.png
│ │ │ ├── Icon180.png
│ │ │ ├── Icon20.png
│ │ │ ├── Icon29.png
│ │ │ ├── Icon40.png
│ │ │ ├── Icon58.png
│ │ │ ├── Icon60.png
│ │ │ ├── Icon76.png
│ │ │ ├── Icon80.png
│ │ │ └── Icon87.png
│ └── Resources
│ │ ├── Default-568h@2x.png
│ │ ├── Fonts
│ │ └── uno-fluentui-assets.ttf
│ │ ├── SplashScreen@2x.png
│ │ └── SplashScreen@3x.png
├── MacOS
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── AppIcon-128.png
│ │ │ ├── AppIcon-128@2x.png
│ │ │ ├── AppIcon-16.png
│ │ │ ├── AppIcon-16@2x.png
│ │ │ ├── AppIcon-256.png
│ │ │ ├── AppIcon-256@2x.png
│ │ │ ├── AppIcon-32.png
│ │ │ ├── AppIcon-32@2x.png
│ │ │ ├── AppIcon-512.png
│ │ │ ├── AppIcon-512@2x.png
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ └── unologo.imageset
│ │ │ ├── Contents.json
│ │ │ └── unoplatform.jpg
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.macOS.cs
│ └── Resources
│ │ └── Fonts
│ │ └── uno-fluentui-assets.ttf
├── UnoTetris.Mobile.csproj
└── iOS
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── LaunchScreen.storyboard
│ ├── Main.iOS.cs
│ ├── Media.xcassets
│ ├── AppIcons.appiconset
│ │ ├── Contents.json
│ │ ├── Icon1024.png
│ │ ├── Icon120.png
│ │ ├── Icon152.png
│ │ ├── Icon167.png
│ │ ├── Icon180.png
│ │ ├── Icon20.png
│ │ ├── Icon29.png
│ │ ├── Icon40.png
│ │ ├── Icon58.png
│ │ ├── Icon60.png
│ │ ├── Icon76.png
│ │ ├── Icon80.png
│ │ └── Icon87.png
│ └── LaunchImages.launchimage
│ │ └── Contents.json
│ └── Resources
│ ├── Default-568h@2x.png
│ ├── Fonts
│ └── uno-fluentui-assets.ttf
│ ├── SplashScreen@2x.png
│ └── SplashScreen@3x.png
├── UnoTetris.Skia.Gtk
├── Program.cs
└── UnoTetris.Skia.Gtk.csproj
├── UnoTetris.Skia.Wpf
├── UnoTetris.Skia.Wpf.csproj
└── Wpf
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml
│ └── MainWindow.xaml.cs
├── UnoTetris.Wasm
├── Assets
│ ├── AppIcon-128.png
│ ├── AppIcon-16.png
│ ├── AppIcon-256.png
│ ├── AppIcon-32.png
│ ├── AppIcon-512.png
│ └── SplashScreen.png
├── InputService.cs
├── LinkerConfig.xml
├── Program.cs
├── Properties
│ └── launchSettings.json
├── UnoTetris.Wasm.csproj
├── WasmCSS
│ └── Fonts.css
├── WasmScripts
│ └── AppManifest.js
└── wwwroot
│ └── web.config
├── UnoTetris.Windows
├── Images
│ ├── LockScreenLogo.scale-200.png
│ ├── SplashScreen.scale-200.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── StoreLogo.png
│ └── Wide310x150Logo.scale-200.png
├── InputService.cs
├── Package.appxmanifest
├── Properties
│ └── launchSettings.json
├── UnoTetris.Windows.csproj
└── app.manifest
└── UnoTetris
├── App.cs
├── AppResources.xaml
├── Assets
├── Background.png
├── Block-Empty.png
├── Block-I.png
├── Block-J.png
├── Block-L.png
├── Block-O.png
├── Block-S.png
├── Block-T.png
├── Block-Z.png
├── TileBlue.png
├── TileCyan.png
├── TileEmpty.png
├── TileGreen.png
├── TileOrange.png
├── TilePurple.png
├── TileRed.png
└── TileYellow.png
├── Block.cs
├── BlockQueue.cs
├── Clip.cs
├── GameGrid.cs
├── GameState.cs
├── MainPage.xaml
├── MainPage.xaml.cs
├── Models
├── BlockI.cs
├── BlockJ.cs
├── BlockL.cs
├── BlockO.cs
├── BlockS.cs
├── BlockT.cs
├── BlockZ.cs
├── Position.cs
└── Records.cs
├── Platforms
└── Windows
│ └── WinAPI.cs
├── Services
├── IInputService.cs
└── SillyDependencyService.cs
├── Strings
└── en
│ └── Resources.resw
└── UnoTetris.csproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/.vsconfig:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "components": [
4 | "Microsoft.VisualStudio.Component.CoreEditor",
5 | "Microsoft.VisualStudio.Workload.CoreEditor",
6 | "Microsoft.NetCore.Component.SDK",
7 | "Microsoft.NetCore.Component.DevelopmentTools",
8 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
9 | "Microsoft.NetCore.Component.Web",
10 | "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
11 | "Microsoft.VisualStudio.Component.TextTemplating",
12 | "Microsoft.VisualStudio.Component.IISExpress",
13 | "Component.Microsoft.Web.LibraryManager",
14 | "Microsoft.VisualStudio.ComponentGroup.Web",
15 | "Microsoft.VisualStudio.Component.Web",
16 | "Microsoft.VisualStudio.ComponentGroup.Web.Client",
17 | "Microsoft.VisualStudio.Workload.NetWeb",
18 | "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites",
19 | "Microsoft.VisualStudio.Workload.Azure",
20 | "Microsoft.VisualStudio.Component.Windows10SDK.19041",
21 | "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
22 | "Microsoft.VisualStudio.Component.Debugger.JustInTime",
23 | "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging",
24 | "Microsoft.VisualStudio.Workload.ManagedDesktop",
25 | "Microsoft.Component.NetFX.Native",
26 | "Microsoft.VisualStudio.Component.Graphics",
27 | "Component.OpenJDK",
28 | "Microsoft.VisualStudio.Component.MonoDebugger",
29 | "Microsoft.VisualStudio.Component.Merq",
30 | "Component.Xamarin.RemotedSimulator",
31 | "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine",
32 | "Component.Xamarin",
33 | "Component.Android.SDK32",
34 | "Microsoft.VisualStudio.Workload.NetCrossPlat",
35 | "Microsoft.VisualStudio.Workload.NetCoreTools",
36 | "Microsoft.VisualStudio.ComponentGroup.Maui.All"
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UnoTetris
2 |
3 | This project is a port from [this Tetris game made for WPF](https://github.com/OttoBotCode/Tetris-Game).
4 |
5 | Right now just the desktop targets are working.
6 |
7 |
8 |
9 | https://user-images.githubusercontent.com/20712372/221010527-552d323e-aa3a-4cad-9bdb-362a47dab21d.mp4
10 |
11 | ## Controls
12 |
13 | - Arrow down: Speed up the block drop
14 | - Arrow Left/Right: Moves the block
15 | - Arrow up: Rotates the block ClockWise
16 | - Z: Rotates the block CounterClockWise
17 | - Space: Hard drop the block
18 | - C: Hold the block
19 |
--------------------------------------------------------------------------------
/UnoTetris.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.5.33414.496
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{BC0C61F2-9DC1-4455-AE0B-8494091D07FE}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoTetris", "UnoTetris\UnoTetris\UnoTetris.csproj", "{F3E3C481-0EC0-47DD-8242-3825B0889073}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoTetris.Wasm", "UnoTetris\UnoTetris.Wasm\UnoTetris.Wasm.csproj", "{BAC111C7-27DD-41AA-9881-9E4A7B38B25E}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoTetris.Mobile", "UnoTetris\UnoTetris.Mobile\UnoTetris.Mobile.csproj", "{1B2DAE91-0C82-406D-A4AA-495682396577}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoTetris.Skia.Gtk", "UnoTetris\UnoTetris.Skia.Gtk\UnoTetris.Skia.Gtk.csproj", "{8768422E-6B74-44C9-92AE-1F0043EAF6E2}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoTetris.Windows", "UnoTetris\UnoTetris.Windows\UnoTetris.Windows.csproj", "{E512F60A-EE5F-441A-A07C-47288FC1DC70}"
17 | EndProject
18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoTetris.Skia.Wpf", "UnoTetris\UnoTetris.Skia.Wpf\UnoTetris.Skia.Wpf.csproj", "{E617142B-8347-4198-9E9F-323A23586552}"
19 | EndProject
20 | Global
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Debug|arm64 = Debug|arm64
24 | Debug|x64 = Debug|x64
25 | Debug|x86 = Debug|x86
26 | Release|Any CPU = Release|Any CPU
27 | Release|arm64 = Release|arm64
28 | Release|x64 = Release|x64
29 | Release|x86 = Release|x86
30 | EndGlobalSection
31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|arm64.ActiveCfg = Debug|Any CPU
35 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|arm64.Build.0 = Debug|Any CPU
36 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|x64.ActiveCfg = Debug|Any CPU
37 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|x64.Build.0 = Debug|Any CPU
38 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|x86.ActiveCfg = Debug|Any CPU
39 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Debug|x86.Build.0 = Debug|Any CPU
40 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|Any CPU.ActiveCfg = Release|Any CPU
41 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|Any CPU.Build.0 = Release|Any CPU
42 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|arm64.ActiveCfg = Release|Any CPU
43 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|arm64.Build.0 = Release|Any CPU
44 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|x64.ActiveCfg = Release|Any CPU
45 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|x64.Build.0 = Release|Any CPU
46 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|x86.ActiveCfg = Release|Any CPU
47 | {F3E3C481-0EC0-47DD-8242-3825B0889073}.Release|x86.Build.0 = Release|Any CPU
48 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|arm64.ActiveCfg = Debug|Any CPU
51 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|arm64.Build.0 = Debug|Any CPU
52 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|x64.ActiveCfg = Debug|Any CPU
53 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|x64.Build.0 = Debug|Any CPU
54 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|x86.ActiveCfg = Debug|Any CPU
55 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Debug|x86.Build.0 = Debug|Any CPU
56 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|Any CPU.ActiveCfg = Release|Any CPU
57 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|Any CPU.Build.0 = Release|Any CPU
58 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|arm64.ActiveCfg = Release|Any CPU
59 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|arm64.Build.0 = Release|Any CPU
60 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|x64.ActiveCfg = Release|Any CPU
61 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|x64.Build.0 = Release|Any CPU
62 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|x86.ActiveCfg = Release|Any CPU
63 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E}.Release|x86.Build.0 = Release|Any CPU
64 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|Any CPU.Build.0 = Debug|Any CPU
66 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
67 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|arm64.ActiveCfg = Debug|Any CPU
68 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|arm64.Build.0 = Debug|Any CPU
69 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|arm64.Deploy.0 = Debug|Any CPU
70 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|x64.ActiveCfg = Debug|Any CPU
71 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|x64.Build.0 = Debug|Any CPU
72 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|x64.Deploy.0 = Debug|Any CPU
73 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|x86.ActiveCfg = Debug|Any CPU
74 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|x86.Build.0 = Debug|Any CPU
75 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Debug|x86.Deploy.0 = Debug|Any CPU
76 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|Any CPU.ActiveCfg = Release|Any CPU
77 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|Any CPU.Build.0 = Release|Any CPU
78 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|Any CPU.Deploy.0 = Release|Any CPU
79 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|arm64.ActiveCfg = Release|Any CPU
80 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|arm64.Build.0 = Release|Any CPU
81 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|arm64.Deploy.0 = Release|Any CPU
82 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|x64.ActiveCfg = Release|Any CPU
83 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|x64.Build.0 = Release|Any CPU
84 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|x64.Deploy.0 = Release|Any CPU
85 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|x86.ActiveCfg = Release|Any CPU
86 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|x86.Build.0 = Release|Any CPU
87 | {1B2DAE91-0C82-406D-A4AA-495682396577}.Release|x86.Deploy.0 = Release|Any CPU
88 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
89 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
90 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|arm64.ActiveCfg = Debug|Any CPU
91 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|arm64.Build.0 = Debug|Any CPU
92 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|x64.ActiveCfg = Debug|Any CPU
93 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|x64.Build.0 = Debug|Any CPU
94 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|x86.ActiveCfg = Debug|Any CPU
95 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Debug|x86.Build.0 = Debug|Any CPU
96 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
97 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|Any CPU.Build.0 = Release|Any CPU
98 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|arm64.ActiveCfg = Release|Any CPU
99 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|arm64.Build.0 = Release|Any CPU
100 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|x64.ActiveCfg = Release|Any CPU
101 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|x64.Build.0 = Release|Any CPU
102 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|x86.ActiveCfg = Release|Any CPU
103 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2}.Release|x86.Build.0 = Release|Any CPU
104 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|Any CPU.ActiveCfg = Debug|x64
105 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|Any CPU.Build.0 = Debug|x64
106 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|Any CPU.Deploy.0 = Debug|x64
107 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|arm64.ActiveCfg = Debug|arm64
108 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|arm64.Build.0 = Debug|arm64
109 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|arm64.Deploy.0 = Debug|arm64
110 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|x64.ActiveCfg = Debug|x64
111 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|x64.Build.0 = Debug|x64
112 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|x64.Deploy.0 = Debug|x64
113 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|x86.ActiveCfg = Debug|x86
114 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|x86.Build.0 = Debug|x86
115 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Debug|x86.Deploy.0 = Debug|x86
116 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|Any CPU.ActiveCfg = Release|x64
117 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|Any CPU.Build.0 = Release|x64
118 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|Any CPU.Deploy.0 = Release|x64
119 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|arm64.ActiveCfg = Release|arm64
120 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|arm64.Build.0 = Release|arm64
121 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|arm64.Deploy.0 = Release|arm64
122 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|x64.ActiveCfg = Release|x64
123 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|x64.Build.0 = Release|x64
124 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|x64.Deploy.0 = Release|x64
125 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|x86.ActiveCfg = Release|x86
126 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|x86.Build.0 = Release|x86
127 | {E512F60A-EE5F-441A-A07C-47288FC1DC70}.Release|x86.Deploy.0 = Release|x86
128 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
129 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|Any CPU.Build.0 = Debug|Any CPU
130 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|arm64.ActiveCfg = Debug|Any CPU
131 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|arm64.Build.0 = Debug|Any CPU
132 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|x64.ActiveCfg = Debug|Any CPU
133 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|x64.Build.0 = Debug|Any CPU
134 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|x86.ActiveCfg = Debug|Any CPU
135 | {E617142B-8347-4198-9E9F-323A23586552}.Debug|x86.Build.0 = Debug|Any CPU
136 | {E617142B-8347-4198-9E9F-323A23586552}.Release|Any CPU.ActiveCfg = Release|Any CPU
137 | {E617142B-8347-4198-9E9F-323A23586552}.Release|Any CPU.Build.0 = Release|Any CPU
138 | {E617142B-8347-4198-9E9F-323A23586552}.Release|arm64.ActiveCfg = Release|Any CPU
139 | {E617142B-8347-4198-9E9F-323A23586552}.Release|arm64.Build.0 = Release|Any CPU
140 | {E617142B-8347-4198-9E9F-323A23586552}.Release|x64.ActiveCfg = Release|Any CPU
141 | {E617142B-8347-4198-9E9F-323A23586552}.Release|x64.Build.0 = Release|Any CPU
142 | {E617142B-8347-4198-9E9F-323A23586552}.Release|x86.ActiveCfg = Release|Any CPU
143 | {E617142B-8347-4198-9E9F-323A23586552}.Release|x86.Build.0 = Release|Any CPU
144 | EndGlobalSection
145 | GlobalSection(SolutionProperties) = preSolution
146 | HideSolutionNode = FALSE
147 | EndGlobalSection
148 | GlobalSection(NestedProjects) = preSolution
149 | {BAC111C7-27DD-41AA-9881-9E4A7B38B25E} = {BC0C61F2-9DC1-4455-AE0B-8494091D07FE}
150 | {1B2DAE91-0C82-406D-A4AA-495682396577} = {BC0C61F2-9DC1-4455-AE0B-8494091D07FE}
151 | {8768422E-6B74-44C9-92AE-1F0043EAF6E2} = {BC0C61F2-9DC1-4455-AE0B-8494091D07FE}
152 | {E512F60A-EE5F-441A-A07C-47288FC1DC70} = {BC0C61F2-9DC1-4455-AE0B-8494091D07FE}
153 | {E617142B-8347-4198-9E9F-323A23586552} = {BC0C61F2-9DC1-4455-AE0B-8494091D07FE}
154 | EndGlobalSection
155 | GlobalSection(ExtensibilityGlobals) = postSolution
156 | SolutionGuid = {57046535-A48E-4D62-8505-93364A7DC222}
157 | EndGlobalSection
158 | EndGlobal
159 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Base/AppHead.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using Microsoft.UI.Xaml;
3 | using Microsoft.UI.Xaml.Controls;
4 | using Microsoft.UI.Xaml.Navigation;
5 | using System;
6 | using UnoTetris.Services;
7 | using Windows.ApplicationModel;
8 | using Windows.ApplicationModel.Activation;
9 |
10 | namespace UnoTetris;
11 | ///
12 | /// Provides application-specific behavior to supplement the default Application class.
13 | ///
14 | /// Your own code may be placed in the UnoTetris/AppBase.cs class.
15 | ///
16 | public sealed partial class AppHead : App
17 | {
18 | static AppHead()
19 | => InitializeLogging();
20 |
21 | ///
22 | /// Initializes the singleton application object. This is the first line of authored code
23 | /// executed, and as such is the logical equivalent of main() or WinMain().
24 | ///
25 | public AppHead()
26 | => this.InitializeComponent();
27 |
28 | ///
29 | /// Configures global Uno Platform logging
30 | ///
31 | private static void InitializeLogging()
32 | {
33 | #if !__MOBILE__
34 | SillyDependencyService.RegisterSingleton(new InputService());
35 | #endif
36 | #if DEBUG
37 | // Logging is disabled by default for release builds, as it incurs a significant
38 | // initialization cost from Microsoft.Extensions.Logging setup. If startup performance
39 | // is a concern for your application, keep this disabled. If you're running on the web or
40 | // desktop targets, you can use URL or command line parameters to enable it.
41 | //
42 | // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html
43 |
44 | var factory = LoggerFactory.Create(builder =>
45 | {
46 | #if __WASM__
47 | builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider());
48 | #elif __IOS__ && !__MACCATALYST__
49 | builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider());
50 | #elif NETFX_CORE
51 | builder.AddDebug();
52 | #else
53 | builder.AddConsole();
54 | #endif
55 |
56 | // Exclude logs below this level
57 | builder.SetMinimumLevel(LogLevel.Information);
58 |
59 | // Default filters for Uno Platform namespaces
60 | builder.AddFilter("Uno", LogLevel.Warning);
61 | builder.AddFilter("Windows", LogLevel.Warning);
62 | builder.AddFilter("Microsoft", LogLevel.Warning);
63 |
64 | // Generic Xaml events
65 | // builder.AddFilter("Windows.UI.Xaml", LogLevel.Debug );
66 | // builder.AddFilter("Windows.UI.Xaml.VisualStateGroup", LogLevel.Debug );
67 | // builder.AddFilter("Windows.UI.Xaml.StateTriggerBase", LogLevel.Debug );
68 | // builder.AddFilter("Windows.UI.Xaml.UIElement", LogLevel.Debug );
69 | // builder.AddFilter("Windows.UI.Xaml.FrameworkElement", LogLevel.Trace );
70 |
71 | // Layouter specific messages
72 | // builder.AddFilter("Windows.UI.Xaml.Controls", LogLevel.Debug );
73 | // builder.AddFilter("Windows.UI.Xaml.Controls.Layouter", LogLevel.Debug );
74 | // builder.AddFilter("Windows.UI.Xaml.Controls.Panel", LogLevel.Debug );
75 |
76 | // builder.AddFilter("Windows.Storage", LogLevel.Debug );
77 |
78 | // Binding related messages
79 | // builder.AddFilter("Windows.UI.Xaml.Data", LogLevel.Debug );
80 | // builder.AddFilter("Windows.UI.Xaml.Data", LogLevel.Debug );
81 |
82 | // Binder memory references tracking
83 | // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug );
84 |
85 | // RemoteControl and HotReload related
86 | // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information);
87 |
88 | // Debug JS interop
89 | // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug );
90 | });
91 |
92 | global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory;
93 |
94 | #if HAS_UNO
95 | global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize();
96 | #endif
97 | #endif
98 | }
99 | }
100 |
101 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content;
3 | using Android.OS;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using Com.Nostra13.Universalimageloader.Core;
8 | using Microsoft.UI.Xaml.Media;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.Linq;
12 | using System.Text;
13 |
14 | namespace UnoTetris.Droid;
15 | [global::Android.App.ApplicationAttribute(
16 | Label = "@string/ApplicationName",
17 | Icon = "@mipmap/icon",
18 | LargeHeap = true,
19 | HardwareAccelerated = true,
20 | Theme = "@style/AppTheme"
21 | )]
22 | public class Application : Microsoft.UI.Xaml.NativeApplication
23 | {
24 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
25 | : base(() => new AppHead(), javaReference, transfer)
26 | {
27 | ConfigureUniversalImageLoader();
28 | }
29 |
30 | private static void ConfigureUniversalImageLoader()
31 | {
32 | // Create global configuration and initialize ImageLoader with this config
33 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
34 | .Builder(Context)
35 | .Build();
36 |
37 | ImageLoader.Instance.Init(config);
38 |
39 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace UnoTetris;
8 | [Activity(
9 | MainLauncher = true,
10 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
11 | WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
12 | )]
13 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
14 | {
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Resources in this folder are Android-only.
3 |
4 | Images, layout descriptions, binary blobs and string dictionaries can be included
5 | in your application as resource files. Various Android APIs are designed to
6 | operate on the resource IDs instead of dealing with images, strings or binary blobs
7 | directly.
8 |
9 | For example, a sample Android app that contains a user interface layout (main.axml),
10 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
11 | would keep its resources in the "Resources" directory of the application:
12 |
13 | Resources/
14 | drawable/
15 | icon.png
16 |
17 | layout/
18 | main.axml
19 |
20 | values/
21 | strings.xml
22 |
23 | In order to get the build system to recognize Android resources, set the build action to
24 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
25 | instead operate on resource IDs. When you compile an Android application that uses resources,
26 | the build system will package the resources for distribution and generate a class called "R"
27 | (this is an Android convention) that contains the tokens for each one of the resources
28 | included. For example, for the above Resources layout, this is what the R class would expose:
29 |
30 | public class R {
31 | public class drawable {
32 | public const int icon = 0x123;
33 | }
34 |
35 | public class layout {
36 | public const int main = 0x456;
37 | }
38 |
39 | public class strings {
40 | public const int first_string = 0xabc;
41 | public const int second_string = 0xbcd;
42 | }
43 | }
44 |
45 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
46 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
47 | string in the dictionary file values/strings.xml.
48 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-ldpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-tvdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-tvdpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/Android/Resources/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | UnoQuickStart
5 |
6 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
16 |
17 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UILaunchStoryboardName
12 | LaunchScreen
13 | UISupportedInterfaceOrientations
14 |
15 | UIInterfaceOrientationPortrait
16 | UIInterfaceOrientationLandscapeLeft
17 | UIInterfaceOrientationLandscapeRight
18 |
19 | XSAppIconAssets
20 | Media.xcassets/AppIcon.appiconset
21 | UIAppFonts
22 |
23 | Fonts/uno-fluentui-assets.ttf
24 |
25 |
26 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace UnoTetris;
4 | public class EntryPoint
5 | {
6 | // This is the main entry point of the application.
7 | static void Main(string[] args)
8 | {
9 | // if you want to use a different Application Delegate class from "AppDelegate"
10 | // you can specify it here.
11 | UIApplication.Main(args, null, typeof(AppHead));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "29x29",
6 | "idiom": "iphone",
7 | "filename": "Icon58.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "29x29",
12 | "idiom": "iphone",
13 | "filename": "Icon87.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "40x40",
18 | "idiom": "iphone",
19 | "filename": "Icon80.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "60x60",
24 | "idiom": "iphone",
25 | "filename": "Icon180.png"
26 | },
27 | {
28 | "scale": "1x",
29 | "size": "20x20",
30 | "idiom": "ipad",
31 | "filename": "Icon20.png"
32 | },
33 | {
34 | "scale": "2x",
35 | "size": "20x20",
36 | "idiom": "ipad",
37 | "filename": "Icon40.png"
38 | },
39 | {
40 | "scale": "1x",
41 | "size": "29x29",
42 | "idiom": "ipad",
43 | "filename": "Icon29.png"
44 | },
45 | {
46 | "scale": "2x",
47 | "size": "29x29",
48 | "idiom": "ipad",
49 | "filename": "Icon58.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "40x40",
54 | "idiom": "ipad",
55 | "filename": "Icon40.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "40x40",
60 | "idiom": "ipad",
61 | "filename": "Icon80.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "76x76",
66 | "idiom": "ipad",
67 | "filename": "Icon76.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "20x20",
72 | "idiom": "iphone",
73 | "filename": "Icon40.png"
74 | },
75 | {
76 | "scale": "3x",
77 | "size": "20x20",
78 | "idiom": "iphone",
79 | "filename": "Icon60.png"
80 | },
81 | {
82 | "scale": "3x",
83 | "size": "40x40",
84 | "idiom": "iphone",
85 | "filename": "Icon120.png"
86 | },
87 | {
88 | "scale": "2x",
89 | "size": "60x60",
90 | "idiom": "iphone",
91 | "filename": "Icon120.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon120.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon152.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon167.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon180.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon20.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon29.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon40.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon58.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon60.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon76.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon80.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Media.xcassets/AppIcons.appiconset/Icon87.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/SplashScreen@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/SplashScreen@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/SplashScreen@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacCatalyst/Resources/SplashScreen@3x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "filename": "AppIcon-16.png",
5 | "size": "16x16",
6 | "scale": "1x",
7 | "idiom": "mac"
8 | },
9 | {
10 | "filename": "AppIcon-16@2x.png",
11 | "size": "16x16",
12 | "scale": "2x",
13 | "idiom": "mac"
14 | },
15 | {
16 | "filename": "AppIcon-32.png",
17 | "size": "32x32",
18 | "scale": "1x",
19 | "idiom": "mac"
20 | },
21 | {
22 | "filename": "AppIcon-32@2x.png",
23 | "size": "32x32",
24 | "scale": "2x",
25 | "idiom": "mac"
26 | },
27 | {
28 | "filename": "AppIcon-128.png",
29 | "size": "128x128",
30 | "scale": "1x",
31 | "idiom": "mac"
32 | },
33 | {
34 | "filename": "AppIcon-128@2x.png",
35 | "size": "128x128",
36 | "scale": "2x",
37 | "idiom": "mac"
38 | },
39 | {
40 | "filename": "AppIcon-256.png",
41 | "size": "256x256",
42 | "scale": "1x",
43 | "idiom": "mac"
44 | },
45 | {
46 | "filename": "AppIcon-256@2x.png",
47 | "size": "256x256",
48 | "scale": "2x",
49 | "idiom": "mac"
50 | },
51 | {
52 | "filename": "AppIcon-512.png",
53 | "size": "512x512",
54 | "scale": "1x",
55 | "idiom": "mac"
56 | },
57 | {
58 | "filename": "AppIcon-512@2x.png",
59 | "size": "512x512",
60 | "scale": "2x",
61 | "idiom": "mac"
62 | }
63 | ],
64 | "info": {
65 | "version": 1,
66 | "author": "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/unologo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "idiom": "universal"
5 | },
6 | {
7 | "scale": "1x",
8 | "idiom": "universal"
9 | },
10 | {
11 | "filename": "unoplatform.jpg",
12 | "scale": "2x",
13 | "idiom": "universal"
14 | },
15 | {
16 | "scale": "3x",
17 | "idiom": "universal"
18 | },
19 | {
20 | "idiom": "iphone"
21 | },
22 | {
23 | "scale": "1x",
24 | "idiom": "iphone"
25 | },
26 | {
27 | "scale": "2x",
28 | "idiom": "iphone"
29 | },
30 | {
31 | "subtype": "retina4",
32 | "scale": "2x",
33 | "idiom": "iphone"
34 | },
35 | {
36 | "scale": "3x",
37 | "idiom": "iphone"
38 | },
39 | {
40 | "idiom": "ipad"
41 | },
42 | {
43 | "scale": "1x",
44 | "idiom": "ipad"
45 | },
46 | {
47 | "scale": "2x",
48 | "idiom": "ipad"
49 | },
50 | {
51 | "idiom": "watch"
52 | },
53 | {
54 | "scale": "2x",
55 | "idiom": "watch"
56 | },
57 | {
58 | "screenWidth": "{130,145}",
59 | "scale": "2x",
60 | "idiom": "watch"
61 | },
62 | {
63 | "screenWidth": "{146,165}",
64 | "scale": "2x",
65 | "idiom": "watch"
66 | },
67 | {
68 | "idiom": "mac"
69 | },
70 | {
71 | "scale": "1x",
72 | "idiom": "mac"
73 | },
74 | {
75 | "scale": "2x",
76 | "idiom": "mac"
77 | },
78 | {
79 | "idiom": "car"
80 | },
81 | {
82 | "scale": "2x",
83 | "idiom": "car"
84 | },
85 | {
86 | "scale": "3x",
87 | "idiom": "car"
88 | },
89 | {
90 | "appearances": [
91 | {
92 | "appearance": "luminosity",
93 | "value": "dark"
94 | }
95 | ],
96 | "idiom": "universal"
97 | },
98 | {
99 | "appearances": [
100 | {
101 | "appearance": "luminosity",
102 | "value": "dark"
103 | }
104 | ],
105 | "scale": "1x",
106 | "idiom": "universal"
107 | },
108 | {
109 | "appearances": [
110 | {
111 | "appearance": "luminosity",
112 | "value": "dark"
113 | }
114 | ],
115 | "scale": "2x",
116 | "idiom": "universal"
117 | },
118 | {
119 | "appearances": [
120 | {
121 | "appearance": "luminosity",
122 | "value": "dark"
123 | }
124 | ],
125 | "scale": "3x",
126 | "idiom": "universal"
127 | },
128 | {
129 | "appearances": [
130 | {
131 | "appearance": "luminosity",
132 | "value": "dark"
133 | }
134 | ],
135 | "idiom": "iphone"
136 | },
137 | {
138 | "appearances": [
139 | {
140 | "appearance": "luminosity",
141 | "value": "dark"
142 | }
143 | ],
144 | "scale": "1x",
145 | "idiom": "iphone"
146 | },
147 | {
148 | "appearances": [
149 | {
150 | "appearance": "luminosity",
151 | "value": "dark"
152 | }
153 | ],
154 | "scale": "2x",
155 | "idiom": "iphone"
156 | },
157 | {
158 | "subtype": "retina4",
159 | "appearances": [
160 | {
161 | "appearance": "luminosity",
162 | "value": "dark"
163 | }
164 | ],
165 | "scale": "2x",
166 | "idiom": "iphone"
167 | },
168 | {
169 | "appearances": [
170 | {
171 | "appearance": "luminosity",
172 | "value": "dark"
173 | }
174 | ],
175 | "scale": "3x",
176 | "idiom": "iphone"
177 | },
178 | {
179 | "appearances": [
180 | {
181 | "appearance": "luminosity",
182 | "value": "dark"
183 | }
184 | ],
185 | "idiom": "ipad"
186 | },
187 | {
188 | "appearances": [
189 | {
190 | "appearance": "luminosity",
191 | "value": "dark"
192 | }
193 | ],
194 | "scale": "1x",
195 | "idiom": "ipad"
196 | },
197 | {
198 | "appearances": [
199 | {
200 | "appearance": "luminosity",
201 | "value": "dark"
202 | }
203 | ],
204 | "scale": "2x",
205 | "idiom": "ipad"
206 | },
207 | {
208 | "appearances": [
209 | {
210 | "appearance": "luminosity",
211 | "value": "dark"
212 | }
213 | ],
214 | "idiom": "watch"
215 | },
216 | {
217 | "appearances": [
218 | {
219 | "appearance": "luminosity",
220 | "value": "dark"
221 | }
222 | ],
223 | "scale": "2x",
224 | "idiom": "watch"
225 | },
226 | {
227 | "screenWidth": "{130,145}",
228 | "appearances": [
229 | {
230 | "appearance": "luminosity",
231 | "value": "dark"
232 | }
233 | ],
234 | "scale": "2x",
235 | "idiom": "watch"
236 | },
237 | {
238 | "screenWidth": "{146,165}",
239 | "appearances": [
240 | {
241 | "appearance": "luminosity",
242 | "value": "dark"
243 | }
244 | ],
245 | "scale": "2x",
246 | "idiom": "watch"
247 | },
248 | {
249 | "appearances": [
250 | {
251 | "appearance": "luminosity",
252 | "value": "dark"
253 | }
254 | ],
255 | "idiom": "mac"
256 | },
257 | {
258 | "appearances": [
259 | {
260 | "appearance": "luminosity",
261 | "value": "dark"
262 | }
263 | ],
264 | "scale": "1x",
265 | "idiom": "mac"
266 | },
267 | {
268 | "appearances": [
269 | {
270 | "appearance": "luminosity",
271 | "value": "dark"
272 | }
273 | ],
274 | "scale": "2x",
275 | "idiom": "mac"
276 | },
277 | {
278 | "appearances": [
279 | {
280 | "appearance": "luminosity",
281 | "value": "dark"
282 | }
283 | ],
284 | "idiom": "car"
285 | },
286 | {
287 | "appearances": [
288 | {
289 | "appearance": "luminosity",
290 | "value": "dark"
291 | }
292 | ],
293 | "scale": "2x",
294 | "idiom": "car"
295 | },
296 | {
297 | "appearances": [
298 | {
299 | "appearance": "luminosity",
300 | "value": "dark"
301 | }
302 | ],
303 | "scale": "3x",
304 | "idiom": "car"
305 | },
306 | {
307 | "appearances": [
308 | {
309 | "appearance": "luminosity",
310 | "value": "light"
311 | }
312 | ],
313 | "idiom": "universal"
314 | },
315 | {
316 | "appearances": [
317 | {
318 | "appearance": "luminosity",
319 | "value": "light"
320 | }
321 | ],
322 | "scale": "1x",
323 | "idiom": "universal"
324 | },
325 | {
326 | "appearances": [
327 | {
328 | "appearance": "luminosity",
329 | "value": "light"
330 | }
331 | ],
332 | "scale": "2x",
333 | "idiom": "universal"
334 | },
335 | {
336 | "appearances": [
337 | {
338 | "appearance": "luminosity",
339 | "value": "light"
340 | }
341 | ],
342 | "scale": "3x",
343 | "idiom": "universal"
344 | },
345 | {
346 | "appearances": [
347 | {
348 | "appearance": "luminosity",
349 | "value": "light"
350 | }
351 | ],
352 | "idiom": "iphone"
353 | },
354 | {
355 | "appearances": [
356 | {
357 | "appearance": "luminosity",
358 | "value": "light"
359 | }
360 | ],
361 | "scale": "1x",
362 | "idiom": "iphone"
363 | },
364 | {
365 | "appearances": [
366 | {
367 | "appearance": "luminosity",
368 | "value": "light"
369 | }
370 | ],
371 | "scale": "2x",
372 | "idiom": "iphone"
373 | },
374 | {
375 | "subtype": "retina4",
376 | "appearances": [
377 | {
378 | "appearance": "luminosity",
379 | "value": "light"
380 | }
381 | ],
382 | "scale": "2x",
383 | "idiom": "iphone"
384 | },
385 | {
386 | "appearances": [
387 | {
388 | "appearance": "luminosity",
389 | "value": "light"
390 | }
391 | ],
392 | "scale": "3x",
393 | "idiom": "iphone"
394 | },
395 | {
396 | "appearances": [
397 | {
398 | "appearance": "luminosity",
399 | "value": "light"
400 | }
401 | ],
402 | "idiom": "ipad"
403 | },
404 | {
405 | "appearances": [
406 | {
407 | "appearance": "luminosity",
408 | "value": "light"
409 | }
410 | ],
411 | "scale": "1x",
412 | "idiom": "ipad"
413 | },
414 | {
415 | "appearances": [
416 | {
417 | "appearance": "luminosity",
418 | "value": "light"
419 | }
420 | ],
421 | "scale": "2x",
422 | "idiom": "ipad"
423 | },
424 | {
425 | "appearances": [
426 | {
427 | "appearance": "luminosity",
428 | "value": "light"
429 | }
430 | ],
431 | "idiom": "watch"
432 | },
433 | {
434 | "appearances": [
435 | {
436 | "appearance": "luminosity",
437 | "value": "light"
438 | }
439 | ],
440 | "scale": "2x",
441 | "idiom": "watch"
442 | },
443 | {
444 | "screenWidth": "{130,145}",
445 | "appearances": [
446 | {
447 | "appearance": "luminosity",
448 | "value": "light"
449 | }
450 | ],
451 | "scale": "2x",
452 | "idiom": "watch"
453 | },
454 | {
455 | "screenWidth": "{146,165}",
456 | "appearances": [
457 | {
458 | "appearance": "luminosity",
459 | "value": "light"
460 | }
461 | ],
462 | "scale": "2x",
463 | "idiom": "watch"
464 | },
465 | {
466 | "appearances": [
467 | {
468 | "appearance": "luminosity",
469 | "value": "light"
470 | }
471 | ],
472 | "idiom": "mac"
473 | },
474 | {
475 | "appearances": [
476 | {
477 | "appearance": "luminosity",
478 | "value": "light"
479 | }
480 | ],
481 | "scale": "1x",
482 | "idiom": "mac"
483 | },
484 | {
485 | "appearances": [
486 | {
487 | "appearance": "luminosity",
488 | "value": "light"
489 | }
490 | ],
491 | "scale": "2x",
492 | "idiom": "mac"
493 | },
494 | {
495 | "appearances": [
496 | {
497 | "appearance": "luminosity",
498 | "value": "light"
499 | }
500 | ],
501 | "idiom": "car"
502 | },
503 | {
504 | "appearances": [
505 | {
506 | "appearance": "luminosity",
507 | "value": "light"
508 | }
509 | ],
510 | "scale": "2x",
511 | "idiom": "car"
512 | },
513 | {
514 | "appearances": [
515 | {
516 | "appearance": "luminosity",
517 | "value": "light"
518 | }
519 | ],
520 | "scale": "3x",
521 | "idiom": "car"
522 | }
523 | ],
524 | "info": {
525 | "version": 1,
526 | "author": "xcode"
527 | }
528 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/unologo.imageset/unoplatform.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Assets.xcassets/unologo.imageset/unoplatform.jpg
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleInfoDictionaryVersion
8 | 6.0
9 | CFBundlePackageType
10 | APPL
11 | CFBundleSignature
12 | ????
13 | LSApplicationCategoryType
14 | public.app-category.utilities
15 | NSHumanReadableCopyright
16 | ${AuthorCopyright:HtmlEncode}
17 | NSPrincipalClass
18 | NSApplication
19 | XSAppIconAssets
20 | Assets.xcassets/AppIcons.appiconset
21 | ATSApplicationFontsPath
22 | Fonts/uno-fluentui-assets.ttf
23 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Main.macOS.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 |
3 | namespace UnoTetris;
4 | // This is the main entry point of the application.
5 | public class EntryPoint
6 | {
7 | static void Main(string[] args)
8 | {
9 | NSApplication.Init();
10 | NSApplication.SharedApplication.Delegate = new AppHead();
11 | NSApplication.Main(args);
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/MacOS/Resources/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/MacOS/Resources/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/UnoTetris.Mobile.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net7.0-android
4 | $(TargetFrameworks);net7.0-ios
5 | $(TargetFrameworks);net7.0-maccatalyst
6 |
7 |
8 |
9 |
10 |
11 | true
12 | Exe
13 |
14 | UnoTetris
15 |
16 | com.companyname.UnoTetris
17 | b9692145-73e5-47aa-acbe-34dbb835c35a
18 |
19 | 1.0
20 | 1
21 | true
22 | 14.2
23 | 14.0
24 | 21.0
25 | 10.14
26 |
27 |
28 |
29 | iossimulator-x64
30 | maccatalyst-x64
31 | osx-x64
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | android-arm64
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | $(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep
57 |
58 | $(MtouchExtraArgs) --registrar:static
59 |
60 | $(MtouchExtraArgs) --marshal-objectivec-exceptions:disable
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | $(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep
70 |
71 | $(MtouchExtraArgs) --registrar:static
72 |
73 | $(MtouchExtraArgs) --marshal-objectivec-exceptions:disable
74 |
75 | false
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UILaunchStoryboardName
13 | LaunchScreen
14 | UIRequiredDeviceCapabilities
15 |
16 | armv7
17 | arm64
18 |
19 | UISupportedInterfaceOrientations
20 |
21 | UIInterfaceOrientationPortrait
22 | UIInterfaceOrientationLandscapeLeft
23 | UIInterfaceOrientationLandscapeRight
24 |
25 | UISupportedInterfaceOrientations~ipad
26 |
27 | UIInterfaceOrientationPortrait
28 | UIInterfaceOrientationPortraitUpsideDown
29 | UIInterfaceOrientationLandscapeLeft
30 | UIInterfaceOrientationLandscapeRight
31 |
32 | UIAppFonts
33 |
34 | Fonts/uno-fluentui-assets.ttf
35 |
36 | UIViewControllerBasedStatusBarAppearance
37 |
38 | UILaunchImageMinimumOSVersion
39 | 9.0
40 | UILaunchImageOrientation
41 | Portrait
42 | UILaunchImageSize
43 | {320, 568}
44 | XSAppIconAssets
45 | Media.xcassets/AppIcons.appiconset
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace UnoTetris;
4 | public class EntryPoint
5 | {
6 | // This is the main entry point of the application.
7 | static void Main(string[] args)
8 | {
9 | // if you want to use a different Application Delegate class from "AppDelegate"
10 | // you can specify it here.
11 | UIApplication.Main(args, null, typeof(AppHead));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "29x29",
6 | "idiom": "iphone",
7 | "filename": "Icon58.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "29x29",
12 | "idiom": "iphone",
13 | "filename": "Icon87.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "40x40",
18 | "idiom": "iphone",
19 | "filename": "Icon80.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "60x60",
24 | "idiom": "iphone",
25 | "filename": "Icon180.png"
26 | },
27 | {
28 | "scale": "1x",
29 | "size": "20x20",
30 | "idiom": "ipad",
31 | "filename": "Icon20.png"
32 | },
33 | {
34 | "scale": "2x",
35 | "size": "20x20",
36 | "idiom": "ipad",
37 | "filename": "Icon40.png"
38 | },
39 | {
40 | "scale": "1x",
41 | "size": "29x29",
42 | "idiom": "ipad",
43 | "filename": "Icon29.png"
44 | },
45 | {
46 | "scale": "2x",
47 | "size": "29x29",
48 | "idiom": "ipad",
49 | "filename": "Icon58.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "40x40",
54 | "idiom": "ipad",
55 | "filename": "Icon40.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "40x40",
60 | "idiom": "ipad",
61 | "filename": "Icon80.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "76x76",
66 | "idiom": "ipad",
67 | "filename": "Icon76.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "20x20",
72 | "idiom": "iphone",
73 | "filename": "Icon40.png"
74 | },
75 | {
76 | "scale": "3x",
77 | "size": "20x20",
78 | "idiom": "iphone",
79 | "filename": "Icon60.png"
80 | },
81 | {
82 | "scale": "3x",
83 | "size": "40x40",
84 | "idiom": "iphone",
85 | "filename": "Icon120.png"
86 | },
87 | {
88 | "scale": "2x",
89 | "size": "60x60",
90 | "idiom": "iphone",
91 | "filename": "Icon120.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon120.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon152.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon167.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon180.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon20.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon29.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon40.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon58.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon60.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon76.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon80.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/AppIcons.appiconset/Icon87.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "orientation": "portrait",
5 | "extent": "full-screen",
6 | "minimum-system-version": "7.0",
7 | "scale": "2x",
8 | "size": "640x960",
9 | "idiom": "iphone"
10 | },
11 | {
12 | "orientation": "portrait",
13 | "extent": "full-screen",
14 | "minimum-system-version": "7.0",
15 | "subtype": "retina4",
16 | "scale": "2x",
17 | "size": "640x1136",
18 | "idiom": "iphone"
19 | },
20 | {
21 | "orientation": "portrait",
22 | "extent": "full-screen",
23 | "minimum-system-version": "7.0",
24 | "scale": "1x",
25 | "size": "768x1024",
26 | "idiom": "ipad"
27 | },
28 | {
29 | "orientation": "landscape",
30 | "extent": "full-screen",
31 | "minimum-system-version": "7.0",
32 | "scale": "1x",
33 | "size": "1024x768",
34 | "idiom": "ipad"
35 | },
36 | {
37 | "orientation": "portrait",
38 | "extent": "full-screen",
39 | "minimum-system-version": "7.0",
40 | "scale": "2x",
41 | "size": "1536x2048",
42 | "idiom": "ipad"
43 | },
44 | {
45 | "orientation": "landscape",
46 | "extent": "full-screen",
47 | "minimum-system-version": "7.0",
48 | "scale": "2x",
49 | "size": "2048x1536",
50 | "idiom": "ipad"
51 | }
52 | ],
53 | "properties": {},
54 | "info": {
55 | "version": 1,
56 | "author": ""
57 | }
58 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Resources/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Resources/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Resources/SplashScreen@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Resources/SplashScreen@2x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Mobile/iOS/Resources/SplashScreen@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Mobile/iOS/Resources/SplashScreen@3x.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using GLib;
2 | using System;
3 | using Uno.UI.Runtime.Skia;
4 |
5 | namespace UnoTetris.Skia.Gtk;
6 | public sealed class Program
7 | {
8 | static void Main(string[] args)
9 | {
10 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
11 | {
12 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
13 | expArgs.ExitApplication = true;
14 | };
15 |
16 | var host = new GtkHost(() => new AppHead());
17 |
18 | host.Run();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Gtk/UnoTetris.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net7.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Wpf/UnoTetris.Skia.Wpf.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net7.0-windows
6 | true
7 |
8 |
9 |
10 | <_Parameter1>false
11 |
12 |
13 | <_Parameter1>System.Windows.ResourceDictionaryLocation.None
14 | <_Parameter1_IsLiteral>true
15 | <_Parameter2>System.Windows.ResourceDictionaryLocation.SourceAssembly
16 | <_Parameter2_IsLiteral>true
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Wpf/Wpf/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Wpf/Wpf/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace UnoTetris.WPF;
10 | ///
11 | /// Interaction logic for App.xaml
12 | ///
13 | public partial class App : Application
14 | {
15 | }
16 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Wpf/Wpf/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Skia.Wpf/Wpf/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace UnoTetris.WPF;
17 | ///
18 | /// Interaction logic for MainWindow.xaml
19 | ///
20 | public partial class MainWindow : Window
21 | {
22 | public MainWindow()
23 | {
24 | InitializeComponent();
25 |
26 | root.Content = new global::Uno.UI.Skia.Platform.WpfHost(Dispatcher, () => new UnoTetris.AppHead());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-128.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-16.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-256.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-32.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Wasm/Assets/AppIcon-512.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Assets/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Wasm/Assets/SplashScreen.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/InputService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnoTetris.Services;
3 | using Windows.System;
4 |
5 | namespace UnoTetris;
6 |
7 | public class InputService : IInputService
8 | {
9 | public void ProcessKeyDown(MainPage page, Action action)
10 | {
11 | page.KeyDown += (_, e) => action(e.Key);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using System;
3 |
4 | namespace UnoTetris.Wasm;
5 | public sealed class Program
6 | {
7 | private static App _app;
8 |
9 | static int Main(string[] args)
10 | {
11 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
12 |
13 | return 0;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "UnoTetris.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5000",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/UnoTetris.Wasm.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net7.0
5 | NU1701
6 |
7 |
8 |
9 | true
10 | $(DefineConstants);TRACE;DEBUG
11 | portable
12 | true
13 |
17 | false
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('system-ui'), local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 |
3 | splashScreenImage: "Assets/SplashScreen.png",
4 | splashScreenColor: "transparent",
5 | displayName: "UnoTetris"
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Wasm/wwwroot/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/StoreLogo.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Images/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris.Windows/Images/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/InputService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnoTetris.Services;
7 | using Windows.System;
8 | using static UnoTetrisOld.Platforms.Windows.WinAPI;
9 |
10 | namespace UnoTetris;
11 | public sealed class InputService : IInputService
12 | {
13 | static int m_hHook = 0;
14 | HookProc m_HookProcedure;
15 |
16 | public void ProcessKeyDown(MainPage page, Action action)
17 | {
18 | page.Loaded += OnPageLoaded;
19 |
20 |
21 | void OnPageLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
22 | {
23 | m_HookProcedure = new HookProc(HookProcedure);
24 | m_hHook = SetWindowsHookEx(WH_KEYBOARD, m_HookProcedure, (IntPtr)0, (int)GetCurrentThreadId());
25 |
26 |
27 | void HookProcedure(int nCode, IntPtr wParam, IntPtr lParam)
28 | {
29 | if (nCode < 0) return;
30 |
31 | bool shift = (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Down).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down));
32 |
33 | action(GetVirtualKey());
34 |
35 | static VirtualKey GetVirtualKey()
36 | {
37 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Down).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
38 | return VirtualKey.Down;
39 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Up).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
40 | return VirtualKey.Up;
41 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Left).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
42 | return VirtualKey.Left;
43 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Right).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
44 | return VirtualKey.Right;
45 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Z).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
46 | return VirtualKey.Z;
47 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.C).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
48 | return VirtualKey.C;
49 | if (Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Space).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down))
50 | return VirtualKey.Space;
51 | return VirtualKey.None;
52 | }
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | UnoTetris
16 | UnoTetris
17 | Images\StoreLogo.png
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "UnoTetris.Windows": {
4 | "commandName": "MsixPackage"
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/UnoTetris.Windows.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net7.0-windows10.0.19041.0
5 | 10.0.18362.0
6 | UnoTetris
7 | x86;x64;arm64
8 | win10-x86;win10-x64;win10-arm64
9 | win10-$(Platform).pubxml
10 | en
11 | true
12 | true
13 | MSIX
14 | true
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/App.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using Microsoft.UI.Xaml;
3 | using Microsoft.UI.Xaml.Controls;
4 | using Microsoft.UI.Xaml.Navigation;
5 | using System;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 |
9 | namespace UnoTetris;
10 | ///
11 | /// Provides application-specific behavior to supplement the default Application class.
12 | ///
13 | public partial class App : Application
14 | {
15 | ///
16 | /// Initializes the singleton application object. This is the first line of authored code
17 | /// executed, and as such is the logical equivalent of main() or WinMain().
18 | ///
19 | ///
20 | /// If you're looking for App.xaml.cs, the file is present in each platform head
21 | /// of the solution.
22 | ///
23 | public App()
24 | {
25 | }
26 |
27 | ///
28 | /// Gets the main window of the app.
29 | ///
30 | internal static Window MainWindow { get; private set; }
31 |
32 | ///
33 | /// Invoked when the application is launched normally by the end user. Other entry points
34 | /// will be used such as when the application is launched to open a specific file.
35 | ///
36 | /// Details about the launch request and process.
37 | protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
38 | {
39 | #if DEBUG
40 | if (System.Diagnostics.Debugger.IsAttached)
41 | {
42 | // this.DebugSettings.EnableFrameRateCounter = true;
43 | }
44 | #endif
45 |
46 | #if NET6_0_OR_GREATER && WINDOWS && !HAS_UNO
47 | MainWindow = new Window();
48 | MainWindow.Activate();
49 | MainWindow.Title = "UnoTetris";
50 | #else
51 | MainWindow = Microsoft.UI.Xaml.Window.Current;
52 | #endif
53 | // Do not repeat app initialization when the Window already has content,
54 | // just ensure that the window is active
55 | if (MainWindow.Content is not Frame rootFrame)
56 | {
57 | // Create a Frame to act as the navigation context and navigate to the first page
58 | rootFrame = new Frame();
59 |
60 | rootFrame.NavigationFailed += OnNavigationFailed;
61 |
62 | if (args.UWPLaunchActivatedEventArgs.PreviousExecutionState == ApplicationExecutionState.Terminated)
63 | {
64 | // TODO: Load state from previously suspended application
65 | }
66 |
67 | // Place the frame in the current Window
68 | MainWindow.Content = rootFrame;
69 | }
70 |
71 | #if !(NET6_0_OR_GREATER && WINDOWS)
72 | if (args.UWPLaunchActivatedEventArgs.PrelaunchActivated == false)
73 | #endif
74 | {
75 | if (rootFrame.Content == null)
76 | {
77 | // When the navigation stack isn't restored navigate to the first page,
78 | // configuring the new page by passing required information as a navigation
79 | // parameter
80 | rootFrame.Navigate(typeof(MainPage), args.Arguments);
81 | }
82 | // Ensure the current window is active
83 | MainWindow.Activate();
84 | }
85 | }
86 |
87 | ///
88 | /// Invoked when Navigation to a certain page fails
89 | ///
90 | /// The Frame which failed navigation
91 | /// Details about the navigation failure
92 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
93 | {
94 | throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}");
95 | }
96 |
97 | ///
98 | /// Invoked when application execution is being suspended. Application state is saved
99 | /// without knowing whether the application will be terminated or resumed with the contents
100 | /// of memory still intact.
101 | ///
102 | /// The source of the suspend request.
103 | /// Details about the suspend request.
104 | private void OnSuspending(object sender, SuspendingEventArgs e)
105 | {
106 | var deferral = e.SuspendingOperation.GetDeferral();
107 | //TODO: Save the application state and stop any background activity
108 | deferral.Complete();
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/AppResources.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Background.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-Empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-Empty.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-I.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-I.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-J.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-J.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-L.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-L.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-O.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-O.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-S.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-S.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-T.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-T.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/Block-Z.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/Block-Z.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileBlue.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileCyan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileCyan.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileEmpty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileEmpty.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileGreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileGreen.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileOrange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileOrange.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TilePurple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TilePurple.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileRed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileRed.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Assets/TileYellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pictos/UnoTetris/83245f2df93c0d951ab663a9b616ba2da10cef48/UnoTetris/UnoTetris/Assets/TileYellow.png
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Block.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnoTetris.Model;
7 |
8 | namespace UnoTetris;
9 | public abstract class Block
10 | {
11 | protected abstract Position[][] Tiles { get; }
12 | protected abstract Position StartOffset { get; }
13 | public abstract int Id { get; }
14 |
15 | int rotationState;
16 | Position offset;
17 |
18 | public Block()
19 | {
20 | offset = new (StartOffset.Row, StartOffset.Column);
21 | }
22 |
23 | public IEnumerable TilePositions()
24 | {
25 | foreach (var p in Tiles[rotationState])
26 | yield return new(p.Row + offset.Row, p.Column + offset.Column);
27 | }
28 |
29 | public void RotateCW() =>
30 | rotationState = (rotationState + 1) % Tiles.Length;
31 |
32 | public void RotateCCW()
33 | {
34 | if (rotationState is 0)
35 | {
36 | rotationState = Tiles.Length - 1;
37 | }
38 | else
39 | {
40 | rotationState--;
41 | }
42 | }
43 |
44 | public void Move(int rows, int columns)
45 | {
46 | offset.Row += rows;
47 | offset.Column += columns;
48 | }
49 |
50 | public void Reset()
51 | {
52 | rotationState = 0;
53 | offset.Row = StartOffset.Row;
54 | offset.Column = StartOffset.Column;
55 | }
56 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/BlockQueue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnoTetris.Model;
7 |
8 | namespace UnoTetris;
9 | sealed class BlockQueue
10 | {
11 | private readonly Random random = Random.Shared;
12 |
13 | public Block NextBlock { get; private set; }
14 | public BlockQueue()
15 | {
16 | NextBlock = GetRandomBlock();
17 | }
18 |
19 | public Block GetAndUpdate()
20 | {
21 | var block = NextBlock;
22 |
23 | do
24 | {
25 | NextBlock = GetRandomBlock();
26 | }
27 | while (block.Id == NextBlock.Id);
28 |
29 | return block;
30 | }
31 |
32 | Block GetRandomBlock()
33 | {
34 | return random.Next(0, 7) switch
35 | {
36 | 0 => new BlockI(),
37 | 1 => new BlockJ(),
38 | 2 => new BlockL(),
39 | 3 => new BlockO(),
40 | 4 => new BlockS(),
41 | 5 => new BlockT(),
42 | 6 => new BlockZ(),
43 | _ => throw new InvalidOperationException(),
44 | };
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Clip.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using Microsoft.UI.Xaml.Media;
3 | using Windows.Foundation;
4 |
5 | namespace UnoTetris;
6 | // https://stackoverflow.com/questions/13668236/cliptobounds-property-in-winrt
7 | public class Clip
8 | {
9 | public static bool GetToBounds(DependencyObject depObj)
10 | {
11 | return (bool)depObj.GetValue(ToBoundsProperty);
12 | }
13 |
14 | public static void SetToBounds(DependencyObject depObj, bool clipToBounds)
15 | {
16 | depObj.SetValue(ToBoundsProperty, clipToBounds);
17 | }
18 |
19 | ///
20 | /// Identifies the ToBounds Dependency Property.
21 | ///
22 | public static readonly DependencyProperty ToBoundsProperty =
23 | DependencyProperty.RegisterAttached("ToBounds", typeof(bool),
24 | typeof(Clip), new PropertyMetadata(false, OnToBoundsPropertyChanged));
25 |
26 | private static void OnToBoundsPropertyChanged(DependencyObject d,
27 | DependencyPropertyChangedEventArgs e)
28 | {
29 | if (d is FrameworkElement fe)
30 | {
31 | ClipToBounds(fe);
32 |
33 | // whenever the element which this property is attached to is loaded
34 | // or re-sizes, we need to update its clipping geometry
35 | fe.Loaded += new RoutedEventHandler(fe_Loaded);
36 | fe.SizeChanged += new SizeChangedEventHandler(fe_SizeChanged);
37 | }
38 | }
39 |
40 | ///
41 | /// Creates a rectangular clipping geometry which matches the geometry of the
42 | /// passed element
43 | ///
44 | private static void ClipToBounds(FrameworkElement fe)
45 | {
46 | if (GetToBounds(fe))
47 | {
48 | fe.Clip = new RectangleGeometry()
49 | {
50 | Rect = new Rect(0, 0, fe.ActualWidth, fe.ActualHeight)
51 | };
52 | }
53 | else
54 | {
55 | fe.Clip = null;
56 | }
57 | }
58 |
59 | static void fe_SizeChanged(object sender, SizeChangedEventArgs e)
60 | {
61 | ClipToBounds((sender as FrameworkElement)!);
62 | }
63 |
64 | static void fe_Loaded(object sender, RoutedEventArgs e)
65 | {
66 | ClipToBounds((sender as FrameworkElement)!);
67 | }
68 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/GameGrid.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris;
2 |
3 | sealed class GameGrid
4 | {
5 | readonly int[,] grid;
6 |
7 | public int Rows { get; }
8 | public int Columns { get; }
9 |
10 | public int this[int r, int c]
11 | {
12 | get => grid[r, c];
13 | set => grid[r, c] = value;
14 | }
15 |
16 | public GameGrid(int rows, int columns)
17 | {
18 | Rows = rows;
19 | Columns = columns;
20 | grid = new int[rows, columns];
21 | }
22 |
23 | public bool IsInside(int r, int c) =>
24 | r > 0 && r < Rows && c >= 0 && c < Columns;
25 |
26 | public bool IsEmpty(int r, int c) =>
27 | IsInside(r, c) && grid[r, c] == 0;
28 |
29 | public bool IsRowFull(int r)
30 | {
31 | for (var c = 0; c < Columns; c++)
32 | {
33 | if (grid[r, c] == 0)
34 | return false;
35 | }
36 |
37 | return true;
38 | }
39 |
40 | public bool IsRowEmpty(int r)
41 | {
42 | for (int c = 0; c < Columns; c++)
43 | {
44 | if (grid[r, c] != 0)
45 | {
46 | return false;
47 | }
48 | }
49 |
50 | return true;
51 | }
52 |
53 | public bool IsColumnFull(int c)
54 | {
55 | for (var r = 0; r < Rows; r++)
56 | {
57 | if (grid[r, c] == 0)
58 | return false;
59 | }
60 |
61 | return true;
62 | }
63 |
64 | void ClearRow(int r)
65 | {
66 | for (var i = 0; i < Columns; i++)
67 | grid[r, i] = 0;
68 | }
69 |
70 | void MoveRowDown(int r, int numRows)
71 | {
72 | for (int c = 0; c < Columns; c++)
73 | {
74 | grid[r + numRows, c] = grid[r, c];
75 | grid[r, c] = 0;
76 | }
77 | }
78 |
79 | public int ClearFullRows()
80 | {
81 | var cleared = 0;
82 |
83 | for (int r = Rows - 1; r >= 0; r--)
84 | {
85 | if (IsRowFull(r))
86 | {
87 | ClearRow(r);
88 | cleared++;
89 | }
90 | else if (cleared > 0)
91 | {
92 | MoveRowDown(r, cleared);
93 | }
94 | }
95 |
96 | return cleared;
97 | }
98 |
99 | public void Deconstruct(out int rows, out int columns)
100 | {
101 | rows = Rows;
102 | columns = Columns;
103 | }
104 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/GameState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnoTetris.Model;
3 |
4 | namespace UnoTetris;
5 | sealed class GameState
6 | {
7 | Block currentBlock;
8 |
9 | public Block CurrentBlock
10 | {
11 | get => currentBlock;
12 | private set
13 | {
14 | currentBlock = value;
15 | currentBlock.Reset();
16 |
17 | for (var i = 0; i < 2; i++)
18 | {
19 | currentBlock.Move(1, 0);
20 | if (!BlockFits())
21 | {
22 | currentBlock.Move(-1, 0);
23 | }
24 | }
25 | }
26 | }
27 |
28 | public GameGrid GameGrid { get; } = new(22, 10);
29 |
30 | public BlockQueue BlockQueue { get; } = new();
31 |
32 | public bool GameOver { get; private set; }
33 |
34 | public int Score { get; private set; }
35 |
36 | public Block? HeldBlock { get; private set; }
37 |
38 | public bool CanHold { get; private set; } = true;
39 |
40 | public GameState()
41 | {
42 | currentBlock = BlockQueue.GetAndUpdate();
43 | }
44 |
45 | public void HoldBlock()
46 | {
47 | if (!CanHold)
48 | return;
49 |
50 | if (HeldBlock is null)
51 | {
52 | HeldBlock = CurrentBlock;
53 | CurrentBlock = BlockQueue.GetAndUpdate();
54 | }
55 | else
56 | {
57 | (CurrentBlock, HeldBlock) = (HeldBlock, CurrentBlock);
58 | }
59 |
60 | CanHold = false;
61 | }
62 |
63 | bool BlockFits()
64 | {
65 | foreach (var p in CurrentBlock.TilePositions())
66 | {
67 | if (!GameGrid.IsEmpty(p.Row, p.Column))
68 | return false;
69 | }
70 |
71 | return true;
72 | }
73 |
74 | public void RotateBlockCW()
75 | {
76 | CurrentBlock.RotateCW();
77 |
78 | if (!BlockFits())
79 | {
80 | CurrentBlock.RotateCCW();
81 | }
82 | }
83 |
84 | public void RotateBlockCCW()
85 | {
86 | CurrentBlock.RotateCCW();
87 |
88 | if (!BlockFits())
89 | {
90 | CurrentBlock.RotateCW();
91 | }
92 | }
93 |
94 | public void MoveBlockLeft()
95 | {
96 | CurrentBlock.Move(0, -1);
97 | if (!BlockFits())
98 | {
99 | CurrentBlock.Move(0, 1);
100 | }
101 | }
102 |
103 | public void MoveBlockRight()
104 | {
105 | CurrentBlock.Move(0, 1);
106 | if (!BlockFits())
107 | {
108 | CurrentBlock.Move(0, -1);
109 | }
110 | }
111 |
112 | bool IsGameOver()
113 | {
114 | return !(GameGrid.IsRowEmpty(0) && GameGrid.IsRowEmpty(1));
115 | }
116 |
117 | void PlaceBlock()
118 | {
119 | foreach (var p in CurrentBlock.TilePositions())
120 | {
121 | GameGrid[p.Row, p.Column] = CurrentBlock.Id;
122 | }
123 |
124 | Score += GameGrid.ClearFullRows();
125 |
126 | if (IsGameOver())
127 | {
128 | GameOver = true;
129 | }
130 | else
131 | {
132 | CurrentBlock = BlockQueue.GetAndUpdate();
133 | CanHold = true;
134 | }
135 | }
136 |
137 | public void MoveBlockDown()
138 | {
139 | CurrentBlock.Move(1, 0);
140 |
141 | if (!BlockFits())
142 | {
143 | CurrentBlock.Move(-1, 0);
144 | PlaceBlock();
145 | }
146 | }
147 |
148 | int TileDropDistance(Position p)
149 | {
150 | var drop = 0;
151 |
152 | while(GameGrid.IsEmpty(p.Row + drop +1, p.Column))
153 | {
154 | drop++;
155 | }
156 |
157 | return drop;
158 | }
159 |
160 | public int BlockDropDistance()
161 | {
162 | var drop = GameGrid.Rows;
163 |
164 | foreach (var p in CurrentBlock.TilePositions())
165 | {
166 | drop = Math.Min(drop,TileDropDistance(p));
167 | }
168 |
169 | return drop;
170 | }
171 |
172 | public void DropBlock()
173 | {
174 | CurrentBlock.Move(BlockDropDistance(), 0);
175 | PlaceBlock();
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
31 |
38 |
39 |
40 |
46 |
47 |
51 |
52 |
53 |
57 |
58 |
59 |
64 |
65 |
66 |
70 |
71 |
72 |
78 |
79 |
83 |
84 |
89 |
90 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using Microsoft.UI.Xaml.Controls;
3 | using Microsoft.UI.Xaml.Media;
4 | using Microsoft.UI.Xaml.Media.Imaging;
5 | using System;
6 | using System.Threading.Tasks;
7 | using UnoTetris.Services;
8 | using Windows.System;
9 |
10 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
11 |
12 | namespace UnoTetris;
13 | ///
14 | /// An empty page that can be used on its own or navigated to within a Frame.
15 | ///
16 | public sealed partial class MainPage : Page
17 | {
18 | static readonly Uri baseUrl = new("ms-appx:///UnoTetris/");
19 | readonly ImageSource[] tileImages = new ImageSource[]
20 | {
21 | new BitmapImage(new Uri(baseUrl, "Assets/TileEmpty.png")),
22 | new BitmapImage(new Uri(baseUrl, "Assets/TileCyan.png")),
23 | new BitmapImage(new Uri(baseUrl, "Assets/TileBlue.png")),
24 | new BitmapImage(new Uri(baseUrl, "Assets/TileOrange.png")),
25 | new BitmapImage(new Uri(baseUrl, "Assets/TileYellow.png")),
26 | new BitmapImage(new Uri(baseUrl, "Assets/TileGreen.png")),
27 | new BitmapImage(new Uri(baseUrl, "Assets/TilePurple.png")),
28 | new BitmapImage(new Uri(baseUrl, "Assets/TileRed.png")),
29 | };
30 |
31 | readonly ImageSource[] blockImages = new ImageSource[]
32 | {
33 | new BitmapImage(new Uri(baseUrl, "Assets/Block-Empty.png")),
34 | new BitmapImage(new Uri(baseUrl, "Assets/Block-I.png")),
35 | new BitmapImage(new Uri(baseUrl, "Assets/Block-J.png")),
36 | new BitmapImage(new Uri(baseUrl, "Assets/Block-L.png")),
37 | new BitmapImage(new Uri(baseUrl, "Assets/Block-O.png")),
38 | new BitmapImage(new Uri(baseUrl, "Assets/Block-S.png")),
39 | new BitmapImage(new Uri(baseUrl, "Assets/Block-T.png")),
40 | new BitmapImage(new Uri(baseUrl, "Assets/Block-Z.png")),
41 | };
42 |
43 | readonly Image[,] imageControls;
44 | readonly int maxDelay = 1_000;
45 | readonly int minDelay = 75;
46 | readonly int delayDecrease = 25;
47 |
48 | GameState gameState = new();
49 | public MainPage()
50 | {
51 | this.InitializeComponent();
52 | this.MinWidth = this.MinHeight = 600;
53 | imageControls = SetupGameCanvas(gameState.GameGrid);
54 |
55 |
56 | #if !__MOBILE__
57 | SillyDependencyService.Get()!.ProcessKeyDown(this, OnKeyDown);
58 | #endif
59 | }
60 |
61 | Image[,] SetupGameCanvas(GameGrid gameGrid)
62 | {
63 | var (rows, columns) = gameGrid;
64 | var imgControls = new Image[rows, columns];
65 | var cellSize = 25;
66 |
67 | for (int r = 0; r < rows; r++)
68 | {
69 | for (int c = 0; c < columns; c++)
70 | {
71 | var imageControl = new Image
72 | {
73 | Width = cellSize,
74 | Height = cellSize
75 | };
76 |
77 | Canvas.SetTop(imageControl, (r - 2) * cellSize);
78 | Canvas.SetLeft(imageControl, c * cellSize);
79 | this.gameCanvas.Children.Add(imageControl);
80 | imgControls[r, c] = imageControl;
81 | }
82 | }
83 |
84 | return imgControls;
85 | }
86 |
87 | void DrawGhostBlock(Block block)
88 | {
89 | var dropDistance = gameState.BlockDropDistance();
90 |
91 | foreach (var p in block.TilePositions())
92 | {
93 | imageControls[p.Row + dropDistance, p.Column].Opacity = 0.25;
94 | imageControls[p.Row + dropDistance, p.Column].Source = tileImages[block.Id];
95 | }
96 | }
97 |
98 | void DrawGrid(GameGrid grid)
99 | {
100 | var (rows, columns) = grid;
101 | for (int r = 0; r < rows; r++)
102 | {
103 | for (int c = 0; c < columns; c++)
104 | {
105 | var id = grid[r, c];
106 | imageControls[r, c].Opacity = 1;
107 | imageControls[r, c].Source = tileImages[id];
108 | }
109 | }
110 | }
111 |
112 | void DrawBlock(Block block)
113 | {
114 | foreach (var p in block.TilePositions())
115 | {
116 | imageControls[p.Row, p.Column].Opacity = 1;
117 | imageControls[p.Row, p.Column].Source = tileImages[block.Id];
118 | }
119 | }
120 |
121 | void DrawNextBlock(BlockQueue blockQueue)
122 | {
123 | var next = blockQueue.NextBlock;
124 | nextImage.Source = blockImages[next.Id];
125 | }
126 |
127 | void DrawHeldBlock(Block heldBlock)
128 | {
129 | holdImage.Source = heldBlock is null ? blockImages[0] : blockImages[heldBlock.Id];
130 | }
131 |
132 | void Draw(GameState gameState)
133 | {
134 | DrawGrid(gameState.GameGrid);
135 | DrawGhostBlock(gameState.CurrentBlock);
136 | DrawBlock(gameState.CurrentBlock);
137 | DrawNextBlock(gameState.BlockQueue);
138 | DrawHeldBlock(gameState.HeldBlock);
139 | scoreText.Text = $"Score: {gameState.Score}";
140 | }
141 |
142 | void OnKeyDown(VirtualKey key)
143 | {
144 | if (gameState.GameOver)
145 | return;
146 |
147 |
148 | switch (key)
149 | {
150 | case VirtualKey.Left:
151 | gameState.MoveBlockLeft();
152 | break;
153 | case VirtualKey.Right:
154 | gameState.MoveBlockRight();
155 | break;
156 | case VirtualKey.Down:
157 | gameState.MoveBlockDown();
158 | break;
159 | case VirtualKey.Up:
160 | gameState.RotateBlockCW();
161 | break;
162 | case VirtualKey.Z:
163 | gameState.RotateBlockCCW();
164 | break;
165 | case VirtualKey.C:
166 | gameState.HoldBlock();
167 | break;
168 | case VirtualKey.Space:
169 | gameState.DropBlock();
170 | break;
171 | default:
172 | return;
173 | }
174 |
175 | Draw(gameState);
176 | }
177 |
178 | async Task GameLoopAsync()
179 | {
180 | Draw(gameState);
181 |
182 | while (!gameState.GameOver)
183 | {
184 | var delay = Math.Max(minDelay, maxDelay - (gameState.Score * delayDecrease));
185 | await Task.Delay(delay);
186 | gameState.MoveBlockDown();
187 | Draw(gameState);
188 | }
189 |
190 | GameOverMenu.Visibility = Visibility.Visible;
191 | FinalScoreText.Text = $"Score: {gameState.Score}";
192 | }
193 |
194 | async void gameCanvas_Loaded(object sender, RoutedEventArgs e)
195 | {
196 | await GameLoopAsync();
197 | }
198 |
199 | async void Button_Click(object sender, RoutedEventArgs e)
200 | {
201 | gameState = new();
202 | GameOverMenu.Visibility = Visibility.Collapsed;
203 | await GameLoopAsync();
204 | }
205 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockI.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 | public sealed class BlockI : Block
3 | {
4 | public override int Id => 1;
5 |
6 | protected override Position[][] Tiles => new Position[][]
7 | {
8 | new Position[] {new (1,0), new (1,1), new (1,2), new (1,3)},
9 | new Position[] {new (0,2), new (1,2), new (2,2), new (3,2)},
10 | new Position[] {new (2,0), new (2,1), new (2,2), new (2,3)},
11 | new Position[] {new (0,1), new (1,1), new (2,1), new (3,1)},
12 | };
13 |
14 | protected override Position StartOffset => new(-1, 3);
15 | }
16 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockJ.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | public sealed class BlockJ : Block
4 | {
5 | public override int Id => 2;
6 |
7 | protected override Position[][] Tiles => new Position[][]
8 | {
9 | new Position[] {new (0,0), new (1,0), new (1,1), new (1,2)},
10 | new Position[] {new (0,1), new (0,2), new (1,1), new (2,1)},
11 | new Position[] {new (1,0), new (1,1), new (1,2), new (2,2)},
12 | new Position[] {new (0,1), new (1,1), new (2,0), new (2,1)},
13 | };
14 |
15 | protected override Position StartOffset => new(0, 3);
16 | }
17 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockL.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | public sealed class BlockL : Block
4 | {
5 | public override int Id => 3;
6 |
7 | protected override Position[][] Tiles => new Position[][]
8 | {
9 | new Position[] {new (0,2), new (1,0), new (1,1), new (1,2)},
10 | new Position[] {new (0,1), new (1,1), new (2,1), new (2,2)},
11 | new Position[] {new (1,0), new (1,1), new (1,2), new (2,0)},
12 | new Position[] {new (0,0), new (0,1), new (1,1), new (2,1)},
13 | };
14 |
15 | protected override Position StartOffset => new(0, 3);
16 | }
17 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockO.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | public sealed class BlockO : Block
4 | {
5 | public override int Id => 4;
6 |
7 | protected override Position[][] Tiles => new Position[][]
8 | {
9 | new Position[] {new (0,0), new (0,1), new (1,0), new (1,1)}
10 | };
11 |
12 | protected override Position StartOffset => new(0,4);
13 | }
14 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockS.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | public sealed class BlockS : Block
4 | {
5 | public override int Id => 5;
6 |
7 | protected override Position[][] Tiles => new Position[][]
8 | {
9 | new Position[] {new (0,1), new (0,2), new (1,0), new (1,1)},
10 | new Position[] {new (0,1), new (1,1), new (1,2), new (2,2)},
11 | new Position[] {new (1,1), new (1,2), new (2,0), new (2,1)},
12 | new Position[] {new (0,0), new (1,0), new (1,1), new (2,1)},
13 | };
14 |
15 | protected override Position StartOffset => new(0, 3);
16 | }
17 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockT.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | public sealed class BlockT : Block
4 | {
5 | public override int Id => 6;
6 |
7 | protected override Position[][] Tiles => new Position[][]
8 | {
9 | new Position[] {new (0,1), new (1,0), new (1,1), new (1,2)},
10 | new Position[] {new (0,1), new (1,1), new (1,2), new (2,1)},
11 | new Position[] {new (1,0), new (1,1), new (1,2), new (2,1)},
12 | new Position[] {new (0,1), new (1,0), new (1,1), new (2,1)},
13 | };
14 |
15 | protected override Position StartOffset => new(0, 3);
16 | }
17 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/BlockZ.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | public sealed class BlockZ : Block
4 | {
5 | public override int Id => 7;
6 |
7 | protected override Position[][] Tiles => new Position[][]
8 | {
9 | new Position[] {new (0,0), new (0,1), new (1,1), new (1,2)},
10 | new Position[] {new (0,2), new (1,1), new (1,2), new (2,1)},
11 | new Position[] {new (1,0), new (1,1), new (2,1), new (2,2)},
12 | new Position[] {new (0,1), new (1,0), new (1,1), new (2,0)},
13 | };
14 |
15 | protected override Position StartOffset => new(0, 3);
16 | }
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/Position.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 | public sealed class Position
3 | {
4 | public int Row { get; set; }
5 | public int Column { get; set; }
6 |
7 | public Position(int row, int column)
8 | {
9 | Row = row;
10 | Column = column;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Models/Records.cs:
--------------------------------------------------------------------------------
1 | namespace UnoTetris.Model;
2 |
3 | //public record Position(int Row, int Column);
4 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Platforms/Windows/WinAPI.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using System.Text;
4 |
5 | namespace UnoTetrisOld.Platforms.Windows;
6 | public class WinAPI
7 | {
8 | public delegate void HookProc(int nCode, IntPtr wParam, IntPtr lParam);
9 |
10 | [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
11 | public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
12 |
13 | [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
14 | public static extern bool UnhookWindowsHookEx(int idHook);
15 |
16 | [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
17 | public static extern int CallNextHookEx(int idHook, int nCode, IntPtr wParam, IntPtr lParam);
18 |
19 | [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
20 | public static extern uint GetCurrentThreadId();
21 |
22 | [DllImport("user32.dll")]
23 | public static extern int MapVirtualKey(uint uCode, uint uMapType);
24 |
25 | [DllImport("user32.dll")]
26 | public static extern int ToUnicode(uint virtualKeyCode, uint scanCode,
27 | byte[] keyboardState,
28 | [Out, MarshalAs(UnmanagedType.LPWStr, SizeConst = 64)]
29 | StringBuilder receivingBuffer,
30 | int bufferSize, uint flags);
31 |
32 | public const int WH_MIN = (-1);
33 | public const int WH_MSGFILTER = (-1);
34 | public const int WH_JOURNALRECORD = 0;
35 | public const int WH_JOURNALPLAYBACK = 1;
36 | public const int WH_KEYBOARD = 2;
37 | public const int WH_GETMESSAGE = 3;
38 | public const int WH_CALLWNDPROC = 4;
39 | public const int WH_CBT = 5;
40 | public const int WH_SYSMSGFILTER = 6;
41 | public const int WH_MOUSE = 7;
42 | public const int WH_HARDWARE = 8;
43 | public const int WH_DEBUG = 9;
44 | public const int WH_SHELL = 10;
45 | public const int WH_FOREGROUNDIDLE = 11;
46 | public const int WH_CALLWNDPROCRET = 12;
47 | public const int WH_KEYBOARD_LL = 13;
48 | public const int WH_MOUSE_LL = 14;
49 | public const int WH_MAX = 14;
50 | public const int WH_MINHOOK = WH_MIN;
51 | public const int WH_MAXHOOK = WH_MAX;
52 |
53 | public const int KF_EXTENDED = 0x0100;
54 | public const int KF_DLGMODE = 0x0800;
55 | public const int KF_MENUMODE = 0x1000;
56 | public const int KF_ALTDOWN = 0x2000;
57 | public const int KF_REPEAT = 0x4000;
58 | public const int KF_UP = 0x8000;
59 |
60 | internal static int HIWORD(IntPtr wParam)
61 | {
62 | return (int)((wParam.ToInt64() >> 16) & 0xffff);
63 | }
64 |
65 | internal static int LOWORD(IntPtr wParam)
66 | {
67 | return (int)(wParam.ToInt64() & 0xffff);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Services/IInputService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml.Controls;
2 | using System;
3 | using Windows.System;
4 |
5 | namespace UnoTetris.Services;
6 |
7 | public interface IInputService
8 | {
9 | void ProcessKeyDown(MainPage page, Action action);
10 | }
11 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Services/SillyDependencyService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 |
4 | namespace UnoTetris.Services;
5 | public static class SillyDependencyService
6 | {
7 | static readonly ConcurrentDictionary dependencyImplementations = new();
8 |
9 | public static void RegisterSingleton(TImpl instance)
10 | where T : class
11 | where TImpl : class, T
12 | {
13 | var type = typeof(T);
14 |
15 | if (dependencyImplementations.ContainsKey(type))
16 | return;
17 |
18 | dependencyImplementations.TryAdd(type, instance);
19 | }
20 |
21 | public static T? Get()
22 | where T : class
23 | {
24 | if (dependencyImplementations.TryGetValue(typeof(T), out var instance))
25 | {
26 | return (T)instance;
27 | }
28 |
29 | return null;
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/Strings/en/Resources.resw:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | UnoTetris
122 |
123 |
--------------------------------------------------------------------------------
/UnoTetris/UnoTetris/UnoTetris.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(TargetFrameworks);net7.0-windows10.0.18362
4 | $(TargetFrameworks);net7.0
5 |
9 | <_CanUseMobileTargets Condition="!$([MSBuild]::IsOSPlatform('Linux'))">true
10 |
11 | $(TargetFrameworks);net7.0-android
12 | $(TargetFrameworks);net7.0-ios
13 | $(TargetFrameworks);net7.0-maccatalyst
14 | enable
15 |
16 |
17 |
18 | en
19 | 14.2
20 | 14.0
21 | 21.0
22 | 10.0.18362.0
23 | 10.0.18362.0
24 |
25 |
26 |
27 | true
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | %(Filename)
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------