{"id":478,"date":"2018-03-05T22:14:09","date_gmt":"2018-03-05T22:14:09","guid":{"rendered":"https:\/\/www.mateuszwojtanowicz.pl\/?post_type=jetpack-portfolio&#038;p=478"},"modified":"2024-03-06T22:29:13","modified_gmt":"2024-03-06T22:29:13","slug":"asteroid","status":"publish","type":"jetpack-portfolio","link":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/portfolio\/asteroid\/","title":{"rendered":"Asteroid"},"content":{"rendered":"\n<p><a href=\"https:\/\/github.com\/Baksu\/unity_asteroid\" data-type=\"link\" data-id=\"https:\/\/github.com\/Baksu\/unity_asteroid\">GIT REPOSITORY<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"539\" src=\"http:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/Zrzut-ekranu-2024-03-06-223012.png\" alt=\"\" class=\"wp-image-480\" srcset=\"https:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/Zrzut-ekranu-2024-03-06-223012.png 960w, https:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/Zrzut-ekranu-2024-03-06-223012-300x168.png 300w, https:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/Zrzut-ekranu-2024-03-06-223012-768x431.png 768w, https:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/Zrzut-ekranu-2024-03-06-223012-800x449.png 800w, https:\/\/www.mateuszwojtanowicz.pl\/wp-content\/uploads\/2024\/03\/Zrzut-ekranu-2024-03-06-223012-321x180.png 321w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/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 InitManager : MonoBehaviour\r\n{\r\n\t&#91;SerializeField] private DataManager _dataManager;\r\n\t&#91;SerializeField] private UiMainWindow _mainWindow;\r\n\r\n\tprivate IGameManager _gameManager;\r\n    \r\n\tprivate void Start()\r\n\t{\r\n\t\tLoadGame();\r\n\t}\r\n\r\n\tprivate void LoadGame(){\r\n\t\tCreateManagers();\r\n\t\tEndLoad();\r\n\t}\r\n\r\n\tprivate void CreateManagers()\r\n\t{\r\n\t\tvar bulletsPool = new BulletsPool(_dataManager.BaseGameData.BaseBulletPrefab);\r\n\t\tvar playerManager = new PlayerManager(_dataManager, bulletsPool); \r\n\t\tvar rocksManager = new RocksManager(_dataManager);\r\n\t\tvar scoreManager = new ScoreManager(rocksManager);\r\n\t\t_gameManager = new GameManager(_dataManager, playerManager, rocksManager, scoreManager);\r\n\t\t_mainWindow.Init(scoreManager, _gameManager);\r\n\t}\r\n\r\n\tprivate void EndLoad()\r\n\t{\r\n\t\t_gameManager.Idle();\r\n\t}\r\n}<\/code><\/pre>\n\n\n\n<p>Some other snip<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>public abstract class APoolObject&lt;T> : IPoolManager&lt;T> where T : class, IPoolObject\n{\n\tprivate IObjectPool&lt;T> _pool;\n\tprivate IObjectPool&lt;T> Pool\n\t{\n\t\tget\n\t\t{\n\t\t\tif (_pool == null)\n\t\t\t{\n\t\t\t\t_pool = new LinkedPool&lt;T>(CreateObject);\n\t\t\t}\n\n\t\t\t\treturn _pool;\n\t\t}\n\t}\n\n\tprotected abstract T CreateObject();\n\t\n\tpublic T GetObject()\n\t{\n\t\tvar poolObject = Pool.Get();\n\t\tpoolObject.AfterGet();\n\t\treturn poolObject;\n\t}\n\n\tpublic void ReleaseObject(T poolObject)\n\t{\n\t\tpoolObject.BeforeRelease();\n\t\tPool.Release(poolObject);\n\t}\n}\n\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 Some other snip<\/p>\n","protected":false},"author":1,"featured_media":482,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"jetpack-portfolio-type":[28],"jetpack-portfolio-tag":[12,14,15,16,23,24],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/478"}],"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=478"}],"version-history":[{"count":2,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/478\/revisions"}],"predecessor-version":[{"id":487,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/478\/revisions\/487"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/media\/482"}],"wp:attachment":[{"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/media?parent=478"}],"wp:term":[{"taxonomy":"jetpack-portfolio-type","embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-type?post=478"},{"taxonomy":"jetpack-portfolio-tag","embeddable":true,"href":"https:\/\/www.mateuszwojtanowicz.pl\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-tag?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}