{"id":293539,"date":"2019-08-19T09:00:56","date_gmt":"2019-08-19T09:00:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293539"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293539","title":{"rendered":"\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Command \u0432 Unity"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fef\/cfb\/edf\/fefcfbedf0b2e0711f2e831b0d069ebf.gif\" alt=\"image\"><\/div>\n<p>  \u0412\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043a\u0430\u043a \u0432 \u0438\u0433\u0440\u0430\u0445 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 <i>Super Meat Boy<\/i> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u043f\u043b\u0435\u044f? \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0435\u0451 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0432\u043e\u0434 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0438\u0433\u0440\u043e\u043a, \u0447\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0432\u043e\u0434 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438 \u043c\u043d\u043e\u0433\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>\u0448\u0430\u0431\u043b\u043e\u043d Command<\/em>.<\/p>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d Command (\u00ab\u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00bb) \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u00ab\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c\u00bb (Undo) \u0438 \u00ab\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c\u00bb (Redo) \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d Command \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C# \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430-\u0431\u043e\u0442\u0430 \u043f\u043e \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u043c\u0443 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0443. \u0418\u0437 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435:<\/p>\n<ul>\n<li>\u041e\u0441\u043d\u043e\u0432\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Command.<\/li>\n<li>\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d Command<\/li>\n<li>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<blockquote><p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 Unity \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 C#. \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <em>Unity 2019.1<\/em> \u0438 <em>C# 7<\/em>.<\/p><\/blockquote>\n<p>  <\/p>\n<h2>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 <a href=\"https:\/\/koenig-media.raywenderlich.com\/uploads\/2019\/06\/CommandPatternInUnity-Materials.zip\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>. \u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 Unity \u043f\u0440\u043e\u0435\u043a\u0442 <em>Starter<\/em>.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 <em>RW\/Scenes<\/em> \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0441\u0446\u0435\u043d\u0443 <em>Main<\/em>. \u0421\u0446\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0431\u043e\u0442\u0430 \u0438 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0414\u0438\u0437\u0430\u0439\u043d \u0443\u0440\u043e\u0432\u043d\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u0441\u0435\u0442\u043a\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u043f\u043e \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0443.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/53b\/ab9\/660\/53bab9660bdd0a5017b570d43a57b2d9.png\"><\/div>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 <em>Play<\/em>, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435.<\/p>\n<p>  \u0421\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0446\u0435\u043d\u044b \u2014 \u044d\u0442\u043e GameObject <em>Bot<\/em>. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043e\u043a\u043d\u0435 Hierarchy, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/187\/35e\/acf\/18735eacfd1f8df8920749ea80a12b8f.png\"><\/div>\n<p>  \u0412 Inspector \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <em>Bot<\/em>. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043e\u0442\u0434\u0430\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0432\u043e\u0434\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2a5\/2e3\/2bc\/2a52e32bc7feb6baafae6af958cc4910.png\"><\/div>\n<p>  <\/p>\n<h2>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 \u0431\u043e\u0442\u0430<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 <em>RW\/Scripts<\/em> \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442 <em>Bot<\/em>. \u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 <em>Bot<\/em>. \u041d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430: <code>Move<\/code> \u0438 <code>Shoot<\/code>. \u041f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>Move<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>CardinalDirection<\/code>. <code>CardinalDirection<\/code> \u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435. \u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <code>CardinalDirection<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>Up<\/code>, <code>Down<\/code>, <code>Right<\/code> \u0438\u043b\u0438 <code>Left<\/code>. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e <code>CardinalDirection<\/code> \u0431\u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043f\u043e \u0441\u0435\u0442\u043a\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/02c\/72e\/8ca\/02c72e8ca19f987e6e36774558242058.png\"><\/div>\n<p>  \u041c\u0435\u0442\u043e\u0434 <code>Shoot<\/code> \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u0442\u0430 \u0441\u0442\u0440\u0435\u043b\u044f\u0442\u044c \u0441\u043d\u0430\u0440\u044f\u0434\u0430\u043c\u0438, \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u044e\u0449\u0438\u043c\u0438 <em>\u0436\u0451\u043b\u0442\u044b\u0435 \u0441\u0442\u0435\u043d\u044b<\/em>, \u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0442\u0438\u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0435\u043d.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b34\/f18\/2bb\/b34f182bb9c0bb682606d0c5a1beb0fd.gif\"><\/div>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <code>ResetToLastCheckpoint<\/code>; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442. \u0412 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0435 \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0438 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <em>checkpoint<\/em> (\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438). \u0414\u043b\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0430 \u0431\u043e\u0442\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e <em>\u0437\u0435\u043b\u0451\u043d\u043e\u0439<\/em> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e4c\/d3b\/fc9\/e4cd3bfc9d59944e28d9a22206141888.png\"><\/div>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0431\u043e\u0442 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0442\u043e \u043e\u043d\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0435\u0433\u043e <em>\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439<\/em>. <code>ResetToLastCheckpoint<\/code> \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0431\u043e\u0442\u0430, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044f \u0435\u0433\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/829\/617\/95a\/82961795afe53c9b45f1f8037896783c.gif\"><\/div>\n<p>  \u041f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u043e \u0441\u043a\u043e\u0440\u043e \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <em>Command<\/em>.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Command<\/h2>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d Command \u2014 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 23 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043d\u0438\u0433\u0435 <i>Design Patterns: Elements of Reusable Object-Oriented Software<\/i>, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u00ab\u0431\u0430\u043d\u0434\u043e\u0439 \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u00bb \u2014 \u042d\u0440\u0438\u0445\u043e\u043c \u0413\u0430\u043c\u043c\u0430, \u0420\u0438\u0447\u0430\u0440\u0434\u043e\u043c \u0425\u0435\u043b\u043c\u043e\u043c, \u0420\u0430\u043b\u044c\u0444\u043e\u043c \u0414\u0436\u043e\u043d\u0441\u043e\u043d\u043e\u043c \u0438 \u0414\u0436\u043e\u043d\u043e\u043c \u0412\u043b\u0438\u0441\u0441\u0438\u0434\u0435\u0441\u043e\u043c (<em>GoF<\/em>, Gang of Four).<\/p>\n<p>  \u0410\u0432\u0442\u043e\u0440\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442, \u0447\u0442\u043e \u00ab\u0448\u0430\u0431\u043b\u043e\u043d Command \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043d\u0430\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u0438\u043b\u0438 \u043b\u043e\u0433\u0430, \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00bb.<\/p>\n<p>  \u041e\u0433\u043e! \u042d\u0442\u043e \u043a\u0430\u043a?<\/p>\n<p>  \u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c.<\/p>\n<p>  <em>\u0418\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f<\/em> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/07d\/5c3\/214\/07d5c32142de4fd36bd2cd73c543856a.png\" width=\"50%\" height=\"50%\"><\/div>\n<p>  \u0418\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u042d\u0442\u043e \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439<\/em> \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u00ab\u043a\u043e\u043c\u0430\u043d\u0434\u0443\u00bb \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0434\u043e \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c <em>\u043e\u0447\u0435\u0440\u0435\u0434\u044c<\/em> \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/035\/637\/264\/0356372640076e0829d2a427cf3552f1.png\" width=\"50%\" height=\"50%\"><\/div>\n<p>  <i>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u043a\u043e\u043c\u0430\u043d\u0434<\/i><\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, <em>\u043e\u0431\u0440\u0430\u0442\u0438\u043c\u043e\u0441\u0442\u044c<\/em> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430\u0437\u0430\u0434 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Undo.<\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435?<\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441 <em>Command<\/em> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>Execute<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 (\u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430), \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 <em>Receiver<\/em>. \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e \u0441\u0443\u0442\u0438, \u043c\u0435\u0442\u043e\u0434 Execute <em>\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d<\/em> \u043a\u043b\u0430\u0441\u0441\u043e\u043c Command.<\/p>\n<p>  \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 Command \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u0442\u0435\u043a \u0438 \u0442.\u043f.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 Execute. \u041a\u043b\u0430\u0441\u0441, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>Invoker<\/em>.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>BotCommand<\/code>. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0431\u043e\u0442\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Command.<\/p>\n<h2>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0431\u043e\u0442\u0430<\/h2>\n<p>  <\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Command<\/h3>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d Command. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 <em>RW\/Scripts<\/em> and \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 <em>BotCommand<\/em>. \u041a\u043b\u0430\u0441\u0441 <code>BotCommand<\/code> \u043f\u043e\u043a\u0430 \u043f\u0443\u0441\u0442, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0434\u043e\u043b\u0433\u043e.<\/p>\n<p>  \u0412\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u043a\u043b\u0430\u0441\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">    \/\/1     private readonly string commandName;      \/\/2     public BotCommand(ExecuteCallback executeMethod, string name)     {         Execute = executeMethod;         commandName = name;     }      \/\/3     public delegate void ExecuteCallback(Bot bot);      \/\/4     public ExecuteCallback Execute { get; private set; }      \/\/5     public override string ToString()     {         return commandName;     }<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/p>\n<ol>\n<li>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>commandName<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0415\u0451 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u043c \u043f\u043e\u0437\u0436\u0435 \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435.<\/li>\n<li>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <code>BotCommand<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0441\u0442\u0440\u043e\u043a\u0443. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>Execute<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Command \u0438 \u0435\u0433\u043e <code>name<\/code>.<\/li>\n<li>\u0414\u0435\u043b\u0435\u0433\u0430\u0442 <code>ExecuteCallback<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0418\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c void \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <code>Bot<\/code> (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <em>Bot<\/em>).<\/li>\n<li>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Execute<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>ToString<\/code> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u0441\u0442\u0440\u043e\u043a\u0443 <code>commandName<\/code>. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 UI.<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0438 \u0432\u0441\u0451! \u041c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d Command.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <em>BotInputHandler<\/em> \u0432 \u043f\u0430\u043f\u043a\u0435 <em>RW\/Scripts<\/em>.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u044f\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 <code>BotCommand<\/code>. \u042d\u0442\u0438 \u044d\u043a\u0437\u0435\u043c\u043b\u044f\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f GameObject Bot \u0432\u0432\u0435\u0440\u0445, \u0432\u043d\u0438\u0437, \u0432\u043b\u0435\u0432\u043e \u0438 \u0432\u043f\u0440\u0430\u0432\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u044b.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e, \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cs\">    \/\/1     private static readonly BotCommand MoveUp =         new BotCommand(delegate (Bot bot) { bot.Move(CardinalDirection.Up); }, \"moveUp\");          \/\/2     private static readonly BotCommand MoveDown =         new BotCommand(delegate (Bot bot) { bot.Move(CardinalDirection.Down); }, \"moveDown\");      \/\/3     private static readonly BotCommand MoveLeft =         new BotCommand(delegate (Bot bot) { bot.Move(CardinalDirection.Left); }, \"moveLeft\");      \/\/4     private static readonly BotCommand MoveRight =         new BotCommand(delegate (Bot bot) { bot.Move(CardinalDirection.Right); }, \"moveRight\");      \/\/5     private static readonly BotCommand Shoot =         new BotCommand(delegate (Bot bot) { bot.Shoot(); }, \"shoot\");<\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/programming-guide\/statements-expressions-operators\/anonymous-methods\" rel=\"noopener\">\u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434<\/a>. \u042d\u0442\u043e\u0442 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u043c <code>ExecuteCallback<\/code>.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0430\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u042d\u0442\u043e \u0438\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>ToString<\/code> \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041f\u043e\u0437\u0436\u0435 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u0434\u043b\u044f UI.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u044b\u0445 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043c\u0435\u0442\u043e\u0434 <code>Move<\/code> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>bot<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0443 \u043d\u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u044b <code>MoveUp<\/code>, <code>MoveDown<\/code>, <code>MoveLeft<\/code> \u0438 <code>MoveRight<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 <code>Move<\/code> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>CardinalDirection.Up<\/code>, <code>CardinalDirection.Down<\/code>, <code>CardinalDirection.Left<\/code> \u0438 <code>CardinalDirection.Right<\/code>. \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <i>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Command<\/i>, \u043e\u043d\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f GameObject Bot.<\/p>\n<p>  \u0412 \u043f\u044f\u0442\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>bot<\/code> \u043c\u0435\u0442\u043e\u0434 <code>Shoot<\/code>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0431\u043e\u0442 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043b\u044f\u0442\u044c \u0441\u043d\u0430\u0440\u044f\u0434\u043e\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043a \u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u0432\u043e\u0434.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u0432 <code>BotInputHandler<\/code>, \u0441\u0440\u0430\u0437\u0443 \u0437\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">    public static BotCommand HandleInput()     {         if (Input.GetKeyDown(KeyCode.W))         {             return MoveUp;         }         else if (Input.GetKeyDown(KeyCode.S))         {             return MoveDown;         }         else if (Input.GetKeyDown(KeyCode.D))         {             return MoveRight;         }         else if (Input.GetKeyDown(KeyCode.A))         {             return MoveLeft;         }         else if (Input.GetKeyDown(KeyCode.F))         {             return Shoot;         }          return null;     }<\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 <code>HandleInput<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u043b\u0430\u0432\u0438\u0448\u0438. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0421\u043d\u043e\u0432\u0430 \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 <em>RW\/Scripts<\/em> \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 <em>SceneManager<\/em>. \u0412 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>uiManager<\/code> \u0442\u0438\u043f\u0430 <code>UIManager<\/code>. <\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441 <code>UIManager<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f <em>UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0446\u0435\u043d\u0435. \u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 <code>UIManager<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0437\u043d\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>bot<\/code> \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u043e\u0442\u0430, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0451\u043d\u043d\u044b\u0439 \u043a GameObject <em>Bot<\/em>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043b\u0430\u0441\u0441 <code>SceneManager<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 <code>\/\/1<\/code>:<\/p>\n<pre><code class=\"cs\">    \/\/1     private List&lt;BotCommand&gt; botCommands = new List&lt;BotCommand&gt;();     private Coroutine executeRoutine;          \/\/2     private void Update()     {         if (Input.GetKeyDown(KeyCode.Return))         {             ExecuteCommands();         }         else         {             CheckForBotCommands();         }                }      \/\/3     private void CheckForBotCommands()     {         var botCommand = BotInputHandler.HandleInput();         if (botCommand != null &amp;&amp; executeRoutine == null)         {             AddToCommands(botCommand);         }     }      \/\/4     private void AddToCommands(BotCommand botCommand)     {         botCommands.Add(botCommand);         \/\/5         uiManager.InsertNewText(botCommand.ToString());     }      \/\/6     private void ExecuteCommands()     {         if (executeRoutine != null)         {             return;         }          executeRoutine = StartCoroutine(ExecuteCommandsRoutine());     }      private IEnumerator ExecuteCommandsRoutine()     {         Debug.Log(\"Executing...\");         \/\/7         uiManager.ResetScrollToTop();          \/\/8         for (int i = 0, count = botCommands.Count; i &lt; count; i++)         {             var command = botCommands[i];             command.Execute(bot);             \/\/9             uiManager.RemoveFirstTextLine();             yield return new WaitForSeconds(CommandPauseTime);         }          \/\/10         botCommands.Clear();                  bot.ResetToLastCheckpoint();          executeRoutine = null;     }<\/code><\/pre>\n<p>  \u041e\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u043a\u043e\u0434\u0430! \u041d\u043e \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c; \u043c\u044b \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043e\u043a\u043d\u0435 Game.<\/p>\n<p>  \u041a\u043e\u0434 \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u043f\u043e\u0437\u0436\u0435. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0433\u0440\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Command<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438; \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <em>Play<\/em> \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 Unity.<\/p>\n<p>  \u0423 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043b\u0430\u0432\u0438\u0448 <em>WASD<\/em>. \u0414\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u044b \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 <em>F<\/em>. \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 <em>Enter<\/em>.<\/p>\n<blockquote><p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d, \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p><\/blockquote>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/20b\/ef8\/483\/20bef8483dd70829836bd9234178f5dd.gif\"><\/div>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 UI \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u042d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>commandName<\/code>.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c UI \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0432\u0435\u0440\u0445 \u0438 \u043a\u0430\u043a \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435<\/h3>\n<p>  \u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00ab\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u00bb:<\/p>\n<ol>\n<li>\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 <code>botCommands<\/code> \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b <code>BotCommand<\/code>. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u044f\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434, \u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>executeCoroutine<\/code> \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <code>ExecuteCommandsRoutine<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/li>\n<li><code>Update<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0430\u0436\u0430\u043b \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a\u043b\u0430\u0432\u0438\u0448\u0443 Enter; \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>ExecuteCommands<\/code>, \u0430 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>CheckForBotCommands<\/code>.<\/li>\n<li><code>CheckForBotCommands<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 <code>HandleInput<\/code> \u0438\u0437 <code>BotInputHandler<\/code> \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434, \u0438 \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f<\/em>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f <code>AddToCommands<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0442.\u0435. \u0435\u0441\u043b\u0438 <code>executeRoutine<\/code> \u043d\u0435 \u0440\u0430\u0432\u043d\u043e null, \u0442\u043e \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442, \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043d\u0438\u0447\u0435\u0433\u043e <code>AddToCommands<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/li>\n<li><code>AddToCommands<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 <em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439<\/em> \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 <code>botCommands<\/code>.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>InsertNewText<\/code> \u043a\u043b\u0430\u0441\u0441\u0430 <code>UIManager<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430. \u0421\u0442\u0440\u043e\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u2014 \u044d\u0442\u043e string, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u0430\u043a \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0435\u043c\u0443 <code>commandName<\/code>.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>ExecuteCommands<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>ExecuteCommandsRoutine<\/code>.<\/li>\n<li><code>ResetScrollToTop<\/code> \u0438\u0437 <code>UIManager<\/code> \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442 UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432\u0432\u0435\u0440\u0445. \u042d\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0412 <code>ExecuteCommandsRoutine<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0446\u0438\u043a\u043b <code>for<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 <code>botCommands<\/code> \u0438 \u043e\u0434\u043d\u0430 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043e\u0431\u044a\u0435\u043a\u0442 <code>bot<\/code> \u043c\u0435\u0442\u043e\u0434\u0443, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d\u043d\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>Execute<\/code>. \u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0443\u0437\u0430 \u0432 <code>CommandPauseTime<\/code> \u0441\u0435\u043a\u0443\u043d\u0434.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>RemoveFirstTextLine<\/code> \u0438\u0437 <code>UIManager<\/code> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u0430\u043c\u0443\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0451 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 UI.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 <code>botCommands<\/code> \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u0431\u043e\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>ResetToLastCheckpoint<\/code> \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u0412 \u043a\u043e\u043d\u0446\u0435 <code>executeRoutine<\/code> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>null<\/code> \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Undo \u0438 Redo<\/h2>\n<p>  \u0415\u0449\u0451 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0446\u0435\u043d\u0443 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0437\u0435\u043b\u0451\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<p>  \u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>Undo<\/em> \u0438 <em>Redo<\/em>.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u043a <em>SceneManager.cs<\/em> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f <i>List<\/i> \u0434\u043b\u044f <code>botCommands<\/code>:<\/p>\n<pre><code class=\"cs\">       private Stack&lt;BotCommand&gt; undoStack = new Stack&lt;BotCommand&gt;();<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>undoStack<\/code> \u2014 \u044d\u0442\u043e <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.collections.stack?view=netframework-4.8\" rel=\"noopener\">\u0441\u0442\u0435\u043a<\/a> (\u0438\u0437 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 Collections), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>UndoCommandEntry<\/code> and <code>RedoCommandEntry<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c Undo \u0438 Redo. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 <code>SceneManager<\/code> \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 <code>ExecuteCommandsRoutine<\/code>:<\/p>\n<pre><code class=\"cs\">    private void UndoCommandEntry()     {         \/\/1         if (executeRoutine != null || botCommands.Count == 0)         {             return;         }          undoStack.Push(botCommands[botCommands.Count - 1]);         botCommands.RemoveAt(botCommands.Count - 1);                      \/\/2         uiManager.RemoveLastTextLine();      }      private void RedoCommandEntry()     {         \/\/3         if (undoStack.Count == 0)         {             return;         }          var botCommand = undoStack.Pop();         AddToCommands(botCommand);     }<\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043a\u043e\u0434:<\/p>\n<ol>\n<li>\u0415\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a <code>botCommands<\/code> \u043f\u0443\u0441\u0442, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>UndoCommandEntry<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0441\u0442\u0435\u043a <code>undoStack<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <code>botCommands<\/code>.<\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>RemoveLastTextLine<\/code> \u0438\u0437 <code>UIManager<\/code> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 UI \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0447\u0442\u043e\u0431\u044b UI \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 <code>botCommands<\/code>.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0441\u0442\u0435\u043a <code>undoStack<\/code> \u043f\u0443\u0441\u0442, \u0442\u043e <code>RedoCommandEntry<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b <code>undoStack<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0451 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a <code>botCommands<\/code> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>AddToCommands<\/code>.<\/li>\n<\/ol>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <code>SceneManager<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0442\u0435\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>Update<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"cs\">    if (Input.GetKeyDown(KeyCode.Return))     {         ExecuteCommands();     }     else if (Input.GetKeyDown(KeyCode.U)) \/\/1     {         UndoCommandEntry();     }     else if (Input.GetKeyDown(KeyCode.R)) \/\/2     {         RedoCommandEntry();     }     else     {         CheckForBotCommands();     }<\/code><\/pre>\n<p>  <\/p>\n<ol>\n<li>\u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 <em>U<\/em> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>UndoCommandEntry<\/code>.<\/li>\n<li>\u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 <em>R<\/em> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>RedoCommandEntry<\/code>.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432<\/h3>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438! \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ol>\n<li>\u041f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0447\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0435\u043a <code>undoStack<\/code>.<\/li>\n<li>\u041f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0447\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0435\u043a <code>undoStack<\/code>.<\/li>\n<\/ol>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e, \u043d\u0430\u043c \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>SceneManager<\/code> \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u0412\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 <code>CheckForBotCommands<\/code>:<\/p>\n<pre><code class=\"cs\">    private void AddNewCommand(BotCommand botCommand)     {         undoStack.Clear();         AddToCommands(botCommand);     }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043e\u0447\u0438\u0449\u0430\u0435\u0442 <code>undoStack<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>AddToCommands<\/code>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0432\u044b\u0437\u043e\u0432 <code>AddToCommands<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>CheckForBotCommands<\/code> \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">    AddNewCommand(botCommand);<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>if<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>ExecuteCommands<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434 <code>undoStack<\/code>:<\/p>\n<pre><code class=\"cs\">    undoStack.Clear();<\/code><\/pre>\n<p>  \u0418 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438!<\/p>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0421\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 <em>Play<\/em>. \u0412\u0432\u043e\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435. \u041d\u0430\u0436\u0438\u043c\u0430\u0439\u0442\u0435 <em>U<\/em> \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434. \u041d\u0430\u0436\u0438\u043c\u0430\u0439\u0442\u0435 <em>R<\/em> \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0430 \u043e\u0442\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<div style=\"text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fef\/cfb\/edf\/fefcfbedf0b2e0711f2e831b0d069ebf.gif\" width=\"1024\" height=\"576\"><\/div>\n<p>  \u041f\u043e\u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0437\u0435\u043b\u0451\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438.<\/p>\n<h2>\u041a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0433\u0440, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0432\u0430\u043c \u043a\u043d\u0438\u0433\u0443 <a href=\"http:\/\/gameprogrammingpatterns.com\/\" rel=\"noopener\">Game Programming Patterns<\/a> \u0420\u043e\u0431\u0435\u0440\u0442\u0430 \u041d\u0438\u0441\u0442\u0440\u043e\u043c\u0430.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430\u0445 C#, \u043f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/www.raywenderlich.com\/604358-c-collections-lambdas-and-linq\" rel=\"noopener\">C# Collections, Lambdas, and LINQ<\/a>.<\/p>\n<h3>\u0417\u0430\u0434\u0430\u043d\u0438\u0435<\/h3>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0437\u0435\u043b\u0451\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0430. \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u044f \u0441\u043f\u0440\u044f\u0442\u0430\u043b \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<ul>\n<li>moveUp \u00d7 2<\/li>\n<li>moveRight \u00d7 3<\/li>\n<li>moveUp \u00d7 2<\/li>\n<li>moveLeft<\/li>\n<li>shoot<\/li>\n<li>moveLeft \u00d7 2<\/li>\n<li>moveUp \u00d7 2<\/li>\n<li>moveLeft \u00d7 2<\/li>\n<li>moveDown \u00d7 5<\/li>\n<li>moveLeft<\/li>\n<li>shoot<\/li>\n<li>moveLeft<\/li>\n<li>moveUp \u00d7 3<\/li>\n<li>shoot \u00d7 2<\/li>\n<li>moveUp \u00d7 5<\/li>\n<li>moveRight \u00d7 3<\/li>\n<\/ul>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dab\/f9e\/05f\/dabf9e05f3cb79ab20a6a663108295fe.png\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/463953\/\"> https:\/\/habr.com\/ru\/post\/463953\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fef\/cfb\/edf\/fefcfbedf0b2e0711f2e831b0d069ebf.gif\" alt=\"image\"><\/div>\n<p>  \u0412\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043a\u0430\u043a \u0432 \u0438\u0433\u0440\u0430\u0445 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 <i>Super Meat Boy<\/i> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u043f\u043b\u0435\u044f? \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0435\u0451 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0432\u043e\u0434 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0438\u0433\u0440\u043e\u043a, \u0447\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0432\u043e\u0434 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438 \u043c\u043d\u043e\u0433\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>\u0448\u0430\u0431\u043b\u043e\u043d Command<\/em>.<\/p>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d Command (\u00ab\u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00bb) \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u00ab\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c\u00bb (Undo) \u0438 \u00ab\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c\u00bb (Redo) \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d Command \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C# \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430-\u0431\u043e\u0442\u0430 \u043f\u043e \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u043c\u0443 \u043b\u0430\u0431\u0438\u0440\u0438\u043d\u0442\u0443. \u0418\u0437 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435:<\/p>\n<ul>\n<li>\u041e\u0441\u043d\u043e\u0432\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Command.<\/li>\n<li>\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d Command<\/li>\n<li>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\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-293539","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293539","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=293539"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293539\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}