{"id":485,"date":"2018-03-04T19:35:37","date_gmt":"2018-03-04T19:35:37","guid":{"rendered":"https:\/\/www.mateuszwojtanowicz.pl\/?post_type=jetpack-portfolio&#038;p=485"},"modified":"2024-04-29T12:38:03","modified_gmt":"2024-04-29T12:38:03","slug":"match-3","status":"publish","type":"jetpack-portfolio","link":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/portfolio\/match-3\/","title":{"rendered":"Match 3"},"content":{"rendered":"\n<p><a href=\"https:\/\/github.com\/Baksu\/unity_match3\" data-type=\"link\" data-id=\"https:\/\/github.com\/Baksu\/unity_match3\">GIT REPOSITORY<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"952\" src=\"https:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/match3.gif\" alt=\"\" class=\"wp-image-486\"\/><\/figure>\n\n\n\n<p>The purpose of this small project is to show my programming skills.<\/p>\n\n\n\n<p>Some code snip<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>public class TimeManager : ITimeManager\n{\n\tpublic event EventHandler OnTimeUpdate;\n\tpublic event EventHandler OnTimesUp;\n\t\n\tprivate int _timeToEnd;\n\n\tprivate int TimeToEnd\n\t{\n\t\tget => _timeToEnd;\n\t\tset\n\t\t{\n\t\t\t_timeToEnd = value;\n\t\t\tOnTimeUpdate?.Invoke(this, new OnTimeUpdateEventArgs{ TimeToEnd = _timeToEnd});\n\t\t}\n\t}\n\n\tprivate IDataManager _dataManager;\n\n\tpublic TimeManager(IDataManager dataManager)\n\t{\n\t\t_dataManager = dataManager;\n\t}\n\n\tprivate bool _isRunning;\n\t\t\n\tpublic void StartGame()\n\t{\n\t\tif (!_isRunning)\n\t\t{\n\t\t\t_isRunning = true;\n\t\t\tTimeToEnd = _dataManager.GameplayTimeInSeconds;\n\t\t\tCounting().Forget();\n\t\t}\n\t}\n\n\tprivate async UniTask Counting()\n\t{\n\t\twhile (TimeToEnd > 0 &amp;&amp; _isRunning)\n\t\t{\n\t\t\tawait UniTask.Delay(1000); \/\/wait one second\n\t\t\tTimeToEnd -= 1;\n\t\t}\n\t\n\t\t_isRunning = false;\n\t\tOnTimesUp?.Invoke(this, EventArgs.Empty);\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GIT REPOSITORY The purpose of this small project is to show my programming skills. Some code snip<\/p>\n","protected":false},"author":1,"featured_media":489,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"jetpack-portfolio-type":[28],"jetpack-portfolio-tag":[14,15,16,23,24],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/485"}],"collection":[{"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio"}],"about":[{"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/types\/jetpack-portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/comments?post=485"}],"version-history":[{"count":1,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/485\/revisions"}],"predecessor-version":[{"id":488,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/485\/revisions\/488"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/media\/489"}],"wp:attachment":[{"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"jetpack-portfolio-type","embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-type?post=485"},{"taxonomy":"jetpack-portfolio-tag","embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-tag?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}