{"id":332533,"date":"2022-04-28T15:01:12","date_gmt":"2022-04-28T15:01:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332533"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332533","title":{"rendered":"<span>\u041a \u0447\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b Match-3 \u0434\u043b\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bf3\/616\/0ab\/bf36160abd6789bdbbe28452c388e94c.png\" width=\"1300\" height=\"915\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bf3\/616\/0ab\/bf36160abd6789bdbbe28452c388e94c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0433\u0440\u0430\u043b\u0438 \u0432 Match-3 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435? \u0412\u043e\u0442 \u0438 \u044f \u0431\u044b \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u0432\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044f \u0443\u0436\u0435 \u043e\u043a\u043e\u043b\u043e 10 \u043b\u0435\u0442 \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u043d\u0435 \u0443\u0439\u0442\u0438 \u043b\u0438 \u043c\u043d\u0435 \u0432 \u0433\u0435\u0439\u043c\u0434\u0435\u0432? \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u043e\u0441\u0432\u044f\u0442\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 Unity, \u0430 3D \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c \u0435\u0449\u0451 \u0441\u043e \u0448\u043a\u043e\u043b\u044b.<\/p>\n<p>\u0418 \u0432\u043e\u0442, \u043f\u043e\u0441\u043b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0446\u0438\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u043e\u0432 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438. \u042f \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 X:<\/p>\n<blockquote>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c \u0412\u0430\u0441 \u0437\u0430 \u043e\u0442\u043a\u043b\u0438\u043a \u043d\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u044e &#171;Senior Unity C# Developer&#187;. \u0413\u043e\u0442\u043e\u0432\u044b \u043b\u0438 \u0412\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435?<\/p>\n<\/blockquote>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438 \u0441 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e, \u043d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u0435\u043d\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430, \u0438 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0438 \u0431\u0435\u0440\u0443\u0441\u044c, \u0442\u043e \u0434\u0435\u043b\u0430\u044e \u0435\u0433\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438 \u043d\u0435 \u0434\u043e\u0448\u0451\u043b \u0434\u043e \u044d\u0442\u0430\u043f\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f?<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u0434\u0430\u043d\u0438\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0441\u044b\u043f\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f Match 3<\/p>\n<p><strong>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 (json, SO \u0438 \u0442.\u0434.)<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c X \u043d\u0430 Y \u043a\u043b\u0435\u0442\u043e\u043a \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u043a\u043b\u0435\u0442\u043a\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0432\u0435\u0440\u0445\u0443, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043b, \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0448\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0434\u0430\u044f \u0432\u043d\u0438\u0437 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442 \u0432\u0441\u0451 \u043f\u043e\u043b\u0435<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0444\u0438\u0448\u043a\u0438 \u043e\u0441\u044b\u043f\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043d\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 (\u043f\u0443\u0441\u0442\u043e\u0442\u0430 \u0441\u0432\u0435\u0440\u0445\u0443), \u0444\u0438\u0448\u043a\u0438 \u043e\u043f\u0430\u0432\u0448\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0441\u0432\u0435\u0440\u0445\u0443 \u043e\u0441\u044b\u043f\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u043e\u0441\u043c\u043e\u0441:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u044b\u043f\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0444\u0438\u0448\u043a\u0443 \u0438 \u044d\u0442\u0430 \u0444\u0438\u0448\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0441\u043e\u0441\u0435\u0434\u044f\u043c\u0438 \u0442\u0430\u043a\u043e\u0433\u043e-\u0436\u0435 \u0446\u0432\u0435\u0442\u0430 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u0441\u044f, \u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0442\u0430 \u0442\u0430\u043a-\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043e\u0441\u044b\u043f\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439. \u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <strong>\u043a\u043e\u0441\u043c\u043e\u0441<\/strong>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 <strong>\u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430<\/strong>, \u0438 \u0440\u0430\u0437\u0431\u0430\u0432\u0438\u0432 \u044d\u0442\u043e \u0432\u0441\u0451 <strong>\u0431\u0430\u0437\u043e\u0432\u044b\u043c<\/strong>. \u042f \u0431\u044b \u0438 \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0434\u0435\u0442 6 \u0448\u0442\u0443\u043a. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u0438 \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043b\u043e \u043c\u0435\u043d\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u0431\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0432\u0441\u0451 \u043f\u0440\u043e \u0432\u0441\u0451 \u0434\u0430\u0451\u0442\u0441\u044f 7 \u0434\u043d\u0435\u0439 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043d\u0435 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<blockquote>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0435 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0430\u0432\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e.<\/p>\n<\/blockquote>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u0442\u0440\u0438 \u0432\u0435\u0447\u0435\u0440\u0430, \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f Match-3 \u0438\u0433\u0440\u044b.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6268bed8cfffb2b489681b55\" data-style=\"\" id=\"6268bed8cfffb2b489681b55\" width=\"\"><\/div>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043d\u043e\u0441\u043d\u043e. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u0434 \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0432\u0435\u0442\u043a\u0435 <a href=\"https:\/\/github.com\/ChebanovDD\/Match3-SDK\/tree\/simple_implementation\" rel=\"noopener noreferrer nofollow\">simple_implementation<\/a>. \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <code>main<\/code> \u0432\u0435\u0442\u043a\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/ChebanovDD\/Match3-SDK\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IBoardFillStrategy<\/code>.<\/p>\n<pre><code class=\"cs\">public interface IBoardFillStrategy {     string Name { get; }      IEnumerable&lt;IJob> GetFillJobs(IGameBoard gameBoard);     IEnumerable&lt;IJob> GetSolveJobs(IGameBoard gameBoard, IEnumerable&lt;ItemSequence> sequences); }<\/code><\/pre>\n<p><code>IJob<\/code> \u044d\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f.<\/p>\n<pre><code class=\"cs\">public interface IJob {     int ExecutionOrder { get; }      UniTask ExecuteAsync(CancellationToken cancellationToken = default); }<\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>ExecutionOrder<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0420\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c <code>ExecutionOrder<\/code> \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">public class ItemsShowJob : Job {     private const float ScaleDuration = 0.5f;      private readonly IEnumerable&lt;IUnityItem> _items;      public ItemsShowJob(IEnumerable&lt;IUnityItem> items, int executionOrder = 0) : base(executionOrder)     {     _items = items;     }      public override async UniTask ExecuteAsync(CancellationToken cancellationToken = default)     {         var itemsSequence = DOTween.Sequence();          foreach (var item in _items)         {             item.SetScale(0);             item.Show();              _ = itemsSequence.Join(item.Transform.DOScale(Vector3.one, ScaleDuration));         }      await itemsSequence.SetEase(Ease.OutBounce).WithCancellation(cancellationToken);     } }<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"cs\">public IEnumerable&lt;IJob> GetFillJobs(IGameBoard gameBoard) {     var itemsToShow = new List&lt;IItem>();      for (var rowIndex = 0; rowIndex &lt; gameBoard.RowCount; rowIndex++)     {         for (var columnIndex = 0; columnIndex &lt; gameBoard.ColumnCount; columnIndex++)         {             var gridSlot = gameBoard[rowIndex, columnIndex];             if (gridSlot.State != GridSlotState.Empty)             {               continue;             }              var item = _itemsPool.GetItem();             item.SetWorldPosition(_gameBoardRenderer.GetWorldPosition(rowIndex, columnIndex));              gridSlot.SetItem(item);             itemsToShow.Add(item);         }     }      return new[] { new ItemsShowJob(itemsToShow) }; }<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">public IEnumerable&lt;IJob> GetSolveJobs(IGameBoard gameBoard, IEnumerable&lt;ItemSequence> sequences) {     var itemsToHide = new List&lt;IUnityItem>();     var itemsToShow = new List&lt;IUnityItem>();      foreach (var solvedGridSlot in sequences.GetUniqueGridSlots())     {         var newItem = _itemsPool.GetItem();         var currentItem = solvedGridSlot.Item;          newItem.SetWorldPosition(currentItem.GetWorldPosition());         solvedGridSlot.SetItem(newItem);          itemsToHide.Add(currentItem);         itemsToShow.Add(newItem);                  _itemsPool.ReturnItem(currentItem);     }      return new IJob[] { new ItemsHideJob(itemsToHide), new ItemsShowJob(itemsToShow) }; }<\/code><\/pre>\n<p>\u0417\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>Solve<\/code> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>IGameBoardSolver<\/code>.<\/p>\n<pre><code class=\"cs\">public interface IGameBoardSolver {     IReadOnlyCollection&lt;ItemSequence> Solve(IGameBoard gameBoard, params GridPosition[] gridPositions); }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u044e\u0431\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e. \u041f\u043b\u044e\u0441 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435, \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0430 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u044f \u0437\u0430\u0445\u043e\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 (\u043b\u0451\u0434, \u043a\u0430\u043c\u0435\u043d\u044c \u0438 \u0442.\u0434.)? \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0441 \u043d\u0435\u043a\u0438\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c &#171;\u043a\u0440\u0430\u0441\u0438\u0432\u043e&#187; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>ISpecialItemDetector&lt;TGridSlot><\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 <code>GameBoardSolver<\/code>.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u043b\u043e\u043a\u0430 \u043a\u0430\u043c\u0435\u043d\u044c:<\/p>\n<pre><code class=\"cs\">public class StoneItemDetector : ISpecialItemDetector&lt;IUnityGridSlot> {     private readonly GridPosition[] _lookupDirections;      public StoneItemDetector()     {         _lookupDirections = new[]         {             GridPosition.Up,             GridPosition.Down,             GridPosition.Left,             GridPosition.Right         };     }      public IEnumerable&lt;IUnityGridSlot> GetSpecialItemGridSlots(IGameBoard&lt;IUnityGridSlot> gameBoard,         IUnityGridSlot gridSlot)     {         foreach (var lookupDirection in _lookupDirections)         {             var lookupPosition = gridSlot.GridPosition + lookupDirection;             if (gameBoard.IsPositionOnGrid(lookupPosition) == false)             {                 continue;             }              var lookupGridSlot = gameBoard[lookupPosition];             if (lookupGridSlot.State.GroupId == (int) TileGroup.Stone)             {                 yield return lookupGridSlot;             }         }     } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IStatefulSlot<\/code>.<\/p>\n<pre><code class=\"cs\">public interface IStatefulSlot {   bool NextState();   void ResetState(); }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a <code>NextState<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>false<\/code>.<\/p>\n<pre><code class=\"cs\">public override IEnumerable&lt;IJob> GetSolveJobs(IGameBoard&lt;IUnityGridSlot> gameBoard,     SolvedData&lt;IUnityGridSlot> solvedData) {     var itemsToHide = new List&lt;IUnityItem>();     var itemsToShow = new List&lt;IUnityItem>();      foreach (var solvedGridSlot in solvedData.GetUniqueSolvedGridSlots(true))     {         var newItem = _itemsPool.GetItem();         var currentItem = solvedGridSlot.Item;          newItem.SetWorldPosition(currentItem.GetWorldPosition());         solvedGridSlot.SetItem(newItem);          itemsToHide.Add(currentItem);         itemsToShow.Add(newItem);          _itemsPool.ReturnItem(currentItem);     }      foreach (var specialItemGridSlot in solvedData.GetSpecialItemGridSlots(true))     {         var item = _itemsPool.GetItem();         item.SetWorldPosition(_gameBoardRenderer.GetWorldPosition(specialItemGridSlot.GridPosition));          specialItemGridSlot.SetItem(item);         itemsToShow.Add(item);     }      return new IJob[] { new ItemsHideJob(itemsToHide), new ItemsShowJob(itemsToShow) }; }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/62693fbbde22274fb4bad93b\" data-style=\"\" id=\"62693fbbde22274fb4bad93b\" width=\"\"><\/div>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u0435\u043d\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u0435\u0442\u0438\u043b\u0430 \u043c\u043e\u044e \u0433\u043e\u043b\u043e\u0432\u0443, \u0430 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043c\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435? \u0421\u043c\u043e\u0433\u0443 \u043b\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0438\u0433\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438? \u0418 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0432, \u0447\u0442\u043e \u043d\u0430 \u0434\u043d\u044f\u0445 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/semack\/terminal-tetris\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435<\/a> \u0440\u0435\u0448\u0438\u043b, \u0430 \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0432\u0438\u0436\u043e\u043a? <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0441\u043b\u043e\u0438 \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0436\u0451\u0441\u0442\u043a\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a Unity, \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 Unity \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e UniTask, \u0430 \u043e\u043d \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u0441\u0435\u0445 \u043f\u043b\u044e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0432 \u0441\u0432\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/post\/652483\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u0438\u043c\u0435\u0435\u0442 \u0435\u0449\u0451 \u0438 .NET Core \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043a\u0430\u043a <a href=\"https:\/\/www.nuget.org\/packages\/UniTask\/\" rel=\"noopener noreferrer nofollow\">nuget<\/a> \u043f\u0430\u043a\u0435\u0442. \u0412\u0441\u0451 \u044d\u0442\u043e \u0432\u043a\u0443\u043f\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u043b\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043e\u0434\u0438\u043d \u0432\u0435\u0447\u0435\u0440.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0442\u043e\u0442 \u0436\u0435 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6268dc015bce1f4fead986cf\" data-style=\"\" id=\"6268dc015bce1f4fead986cf\" width=\"\"><\/div>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041d\u043e \u0431\u044b\u043b\u0438 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432\u0432\u043e\u0434\u0430. \u0412 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 \u0441\u043a\u0440\u044b\u0442\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>Match3Game<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IInputSystem<\/code>. \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432\u0432\u043e\u0434\u0430 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0438 \u043c\u044b\u0448\u0438, \u0442\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0438\u0445 \u043c\u0430\u043b\u043e \u043e\u0431\u0449\u0435\u0433\u043e.<\/p>\n<pre><code class=\"cs\">public interface ITerminalInputSystem {     event EventHandler&lt;ConsoleKey> KeyPressed;     event EventHandler Break;      void StartMonitoring();     void StopMonitoring(); }<\/code><\/pre>\n<pre><code class=\"cs\">public interface IUnityInputSystem {     event EventHandler&lt;PointerEventArgs> PointerDown;     event EventHandler&lt;PointerEventArgs> PointerDrag;     event EventHandler&lt;PointerEventArgs> PointerUp; }<\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u043e\u0433\u0438\u043a\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>Match3Game<\/code> \u043e\u043f\u0438\u0440\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0430\u043b\u044c\u0446\u0430 \u0438\u043b\u0438 \u043c\u044b\u0448\u0438, \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0430 \u0431\u0430\u0437\u0435 <code>IUnityInputSystem<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u043a\u0430\u043a \u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u043b, \u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u044d\u0442\u043e \u043a\u0430\u043a \u043a\u043e\u0441\u0442\u044b\u043b\u044c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <code>Match3Game<\/code> \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u044b\u043f\u0438\u043b\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IInputSystem<\/code>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u044b\u043b\u0438\u043b\u043e\u0441\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Match-3 \u0438\u0433\u0440.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 <a href=\"https:\/\/github.com\/ChebanovDD\/Match3-SDK\/blob\/main\/LICENSE\" rel=\"noopener noreferrer nofollow\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0410 \u0432\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/ChebanovDD\/Match3-SDK\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<p>\u0410\u0445 \u0434\u0430, \u0447\u0443\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435 <a href=\"https:\/\/openupm.com\/\" rel=\"noopener noreferrer nofollow\">OpenUPM<\/a> \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 npm, \u043e\u0442\u0447\u0435\u0433\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>Match3.Core<\/code> \u043c\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 \u043f\u0430\u043a\u0435\u0442. \u041d\u043e \u0441\u0432\u044f\u0437\u0430\u0432\u0448\u0438\u0441\u044c \u0441 \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u043e\u0431\u043d\u043e\u0432\u0438\u043b npm \u0434\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041a\u0442\u043e \u0431\u044b \u043c\u043e\u0433 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u0430\u0434\u0430 \u0432 open source \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e?<\/p>\n<p>\u0410 \u043a\u0430\u043a \u0432\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u0441\u044c \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c?<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/663156\/\"> https:\/\/habr.com\/ru\/post\/663156\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0433\u0440\u0430\u043b\u0438 \u0432 Match-3 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435? \u0412\u043e\u0442 \u0438 \u044f \u0431\u044b \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u0432\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044f \u0443\u0436\u0435 \u043e\u043a\u043e\u043b\u043e 10 \u043b\u0435\u0442 \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u043d\u0435 \u0443\u0439\u0442\u0438 \u043b\u0438 \u043c\u043d\u0435 \u0432 \u0433\u0435\u0439\u043c\u0434\u0435\u0432? \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u043e\u0441\u0432\u044f\u0442\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 Unity, \u0430 3D \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c \u0435\u0449\u0451 \u0441\u043e \u0448\u043a\u043e\u043b\u044b.<\/p>\n<p>\u0418 \u0432\u043e\u0442, \u043f\u043e\u0441\u043b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0446\u0438\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u043e\u0432 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438. \u042f \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 X:<\/p>\n<blockquote>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c \u0412\u0430\u0441 \u0437\u0430 \u043e\u0442\u043a\u043b\u0438\u043a \u043d\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u044e &#171;Senior Unity C# Developer&#187;. \u0413\u043e\u0442\u043e\u0432\u044b \u043b\u0438 \u0412\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435?<\/p>\n<\/blockquote>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438 \u0441 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e, \u043d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u0435\u043d\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430, \u0438 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0438 \u0431\u0435\u0440\u0443\u0441\u044c, \u0442\u043e \u0434\u0435\u043b\u0430\u044e \u0435\u0433\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438 \u043d\u0435 \u0434\u043e\u0448\u0451\u043b \u0434\u043e \u044d\u0442\u0430\u043f\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f?<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u0434\u0430\u043d\u0438\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0441\u044b\u043f\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f Match 3<\/p>\n<p><strong>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 (json, SO \u0438 \u0442.\u0434.)<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c X \u043d\u0430 Y \u043a\u043b\u0435\u0442\u043e\u043a \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u043a\u043b\u0435\u0442\u043a\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0432\u0435\u0440\u0445\u0443, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043b, \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0448\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0434\u0430\u044f \u0432\u043d\u0438\u0437 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442 \u0432\u0441\u0451 \u043f\u043e\u043b\u0435<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0444\u0438\u0448\u043a\u0438 \u043e\u0441\u044b\u043f\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043d\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 (\u043f\u0443\u0441\u0442\u043e\u0442\u0430 \u0441\u0432\u0435\u0440\u0445\u0443), \u0444\u0438\u0448\u043a\u0438 \u043e\u043f\u0430\u0432\u0448\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0441\u0432\u0435\u0440\u0445\u0443 \u043e\u0441\u044b\u043f\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043d\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u043e\u0441\u043c\u043e\u0441:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u044b\u043f\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0444\u0438\u0448\u043a\u0443 \u0438 \u044d\u0442\u0430 \u0444\u0438\u0448\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0441\u043e\u0441\u0435\u0434\u044f\u043c\u0438 \u0442\u0430\u043a\u043e\u0433\u043e-\u0436\u0435 \u0446\u0432\u0435\u0442\u0430 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u0441\u044f, \u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0442\u0430 \u0442\u0430\u043a-\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043e\u0441\u044b\u043f\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439. \u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <strong>\u043a\u043e\u0441\u043c\u043e\u0441<\/strong>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 <strong>\u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430<\/strong>, \u0438 \u0440\u0430\u0437\u0431\u0430\u0432\u0438\u0432 \u044d\u0442\u043e \u0432\u0441\u0451 <strong>\u0431\u0430\u0437\u043e\u0432\u044b\u043c<\/strong>. \u042f \u0431\u044b \u0438 \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0434\u0435\u0442 6 \u0448\u0442\u0443\u043a. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u0438 \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043b\u043e \u043c\u0435\u043d\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u0431\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0432\u0441\u0451 \u043f\u0440\u043e \u0432\u0441\u0451 \u0434\u0430\u0451\u0442\u0441\u044f 7 \u0434\u043d\u0435\u0439 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043d\u0435 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<blockquote>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0435 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0430\u0432\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e.<\/p>\n<\/blockquote>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u0442\u0440\u0438 \u0432\u0435\u0447\u0435\u0440\u0430, \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f Match-3 \u0438\u0433\u0440\u044b.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6268bed8cfffb2b489681b55\" data-style=\"\" id=\"6268bed8cfffb2b489681b55\" width=\"\"><\/div>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043d\u043e\u0441\u043d\u043e. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u0434 \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0432\u0435\u0442\u043a\u0435 <a href=\"https:\/\/github.com\/ChebanovDD\/Match3-SDK\/tree\/simple_implementation\" rel=\"noopener noreferrer nofollow\">simple_implementation<\/a>. \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <code>main<\/code> \u0432\u0435\u0442\u043a\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/ChebanovDD\/Match3-SDK\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IBoardFillStrategy<\/code>.<\/p>\n<pre><code class=\"cs\">public interface IBoardFillStrategy {     string Name { get; }      IEnumerable&lt;IJob> GetFillJobs(IGameBoard gameBoard);     IEnumerable&lt;IJob> GetSolveJobs(IGameBoard gameBoard, IEnumerable&lt;ItemSequence> sequences); }<\/code><\/pre>\n<p><code>IJob<\/code> \u044d\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f.<\/p>\n<pre><code class=\"cs\">public interface IJob {     int ExecutionOrder { get; }      UniTask ExecuteAsync(CancellationToken cancellationToken = default); }<\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>ExecutionOrder<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0420\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c <code>ExecutionOrder<\/code> \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">public class ItemsShowJob : Job {     private const float ScaleDuration = 0.5f;      private readonly IEnumerable&lt;IUnityItem> _items;      public ItemsShowJob(IEnumerable&lt;IUnityItem> items, int executionOrder = 0) : base(executionOrder)     {     _items = items;     }      public override async UniTask ExecuteAsync(CancellationToken cancellationToken = default)     {         var itemsSequence = DOTween.Sequence();          foreach (var item in _items)         {             item.SetScale(0);             item.Show();              _ = itemsSequence.Join(item.Transform.DOScale(Vector3.one, ScaleDuration));         }      await itemsSequence.SetEase(Ease.OutBounce).WithCancellation(cancellationToken);     } }<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"cs\">public IEnumerable&lt;IJob> GetFillJobs(IGameBoard gameBoard) {     var itemsToShow = new List&lt;IItem>();      for (var rowIndex = 0; rowIndex &lt; gameBoard.RowCount; rowIndex++)     {         for (var columnIndex = 0; columnIndex &lt; gameBoard.ColumnCount; columnIndex++)         {             var gridSlot = gameBoard[rowIndex, columnIndex];             if (gridSlot.State != GridSlotState.Empty)             {               continue;             }              var item = _itemsPool.GetItem();             item.SetWorldPosition(_gameBoardRenderer.GetWorldPosition(rowIndex, columnIndex));              gridSlot.SetItem(item);             itemsToShow.Add(item);         }     }      return new[] { new ItemsShowJob(itemsToShow) }; }<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">public IEnumerable&lt;IJob> GetSolveJobs(IGameBoard gameBoard, IEnumerable&lt;ItemSequence> sequences) {     var itemsToHide = new List&lt;IUnityItem>();     var itemsToShow = new List&lt;IUnityItem>();      foreach (var solvedGridSlot in sequences.GetUniqueGridSlots())     {         var newItem = _itemsPool.GetItem();         var currentItem = solvedGridSlot.Item;          newItem.SetWorldPosition(currentItem.GetWorldPosition());         solvedGridSlot.SetItem(newItem);          itemsToHide.Add(currentItem);         itemsToShow.Add(newItem);                  _itemsPool.ReturnItem(currentItem);     }      return new IJob[] { new ItemsHideJob(itemsToHide), new ItemsShowJob(itemsToShow) }; }<\/code><\/pre>\n<p>\u0417\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>Solve<\/code> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>IGameBoardSolver<\/code>.<\/p>\n<pre><code class=\"cs\">public interface IGameBoardSolver {     IReadOnlyCollection&lt;ItemSequence> Solve(IGameBoard gameBoard, params GridPosition[] gridPositions); }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u044e\u0431\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e. \u041f\u043b\u044e\u0441 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435, \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0430 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u044f \u0437\u0430\u0445\u043e\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 (\u043b\u0451\u0434, \u043a\u0430\u043c\u0435\u043d\u044c \u0438 \u0442.\u0434.)? \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0441 \u043d\u0435\u043a\u0438\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c &#171;\u043a\u0440\u0430\u0441\u0438\u0432\u043e&#187; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>ISpecialItemDetector&lt;TGridSlot><\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 <code>GameBoardSolver<\/code>.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u043b\u043e\u043a\u0430 \u043a\u0430\u043c\u0435\u043d\u044c:<\/p>\n<pre><code class=\"cs\">public class StoneItemDetector : ISpecialItemDetector&lt;IUnityGridSlot> {     private readonly GridPosition[] _lookupDirections;      public StoneItemDetector()     {         _lookupDirections = new[]         {             GridPosition.Up,             GridPosition.Down,             GridPosition.Left,             GridPosition.Right         };     }      public IEnumerable&lt;IUnityGridSlot> GetSpecialItemGridSlots(IGameBoard&lt;IUnityGridSlot> gameBoard,         IUnityGridSlot gridSlot)     {         foreach (var lookupDirection in _lookupDirections)         {             var lookupPosition = gridSlot.GridPosition + lookupDirection;             if (gameBoard.IsPositionOnGrid(lookupPosition) == false)             {                 continue;             }              var lookupGridSlot = gameBoard[lookupPosition];             if (lookupGridSlot.State.GroupId == (int) TileGroup.Stone)             {                 yield return lookupGridSlot;             }         }     } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>IStatefulSlot<\/code>.<\/p>\n<pre><code class=\"cs\">public interface IStatefulSlot {   bool NextState();   void ResetState(); }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a <code>NextState<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>false<\/code>.<\/p>\n<pre><code class=\"cs\">public override IEnumerable&lt;IJob> GetSolveJobs(IGameBoard&lt;IUnityGridSlot> gameBoard,     SolvedData&lt;IUnityGridSlot> solvedData) {     var itemsToHide = new List&lt;IUnityItem>();     var itemsToShow = new List&lt;IUnityItem>();      foreach (var solvedGridSlot in solvedData.GetUniqueSolvedGridSlots(true))     {         var newItem = _itemsPool.GetItem();         var currentItem = solvedGridSlot.Item;          newItem.SetWorldPosition(currentItem.GetWorldPosition());         solvedGridSlot.SetItem(newItem);          itemsToHide.Add(currentItem);         itemsToShow.Add(newItem);          _itemsPool.ReturnItem(currentItem);     }      foreach (var specialItemGridSlot in solvedData.GetSpecialItemGridSlots(true))     {         var item = _itemsPool.GetItem();         item.SetWorldPosition(_gameBoardRenderer.GetWorldPosition(specialItemGridSlot.GridPosition));          specialItemGridSlot.SetItem(item);         itemsToShow.Add(item);     }      return new IJob[] { new ItemsHideJob(itemsToHide), new ItemsShowJob(itemsToShow) }; }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/62693fbbde22274fb4bad93b\" data-style=\"\" id=\"62693fbbde22274fb4bad93b\" width=\"\"><\/div>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u0435\u043d\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u0435\u0442\u0438\u043b\u0430 \u043c\u043e\u044e \u0433\u043e\u043b\u043e\u0432\u0443, \u0430 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043c\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435? \u0421\u043c\u043e\u0433\u0443 \u043b\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0438\u0433\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438? \u0418 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0432, \u0447\u0442\u043e \u043d\u0430 \u0434\u043d\u044f\u0445 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/semack\/terminal-tetris\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435<\/a> \u0440\u0435\u0448\u0438\u043b, \u0430 \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0432\u0438\u0436\u043e\u043a? <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0441\u043b\u043e\u0438 \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0436\u0451\u0441\u0442\u043a\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a Unity, \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434,<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-332533","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332533"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332533\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}