{"id":87217,"date":"2026-07-30T02:32:21","date_gmt":"2026-07-29T18:32:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/87217.html"},"modified":"2026-07-30T02:32:21","modified_gmt":"2026-07-29T18:32:21","slug":"%e6%b8%b8%e6%88%8f%e5%86%85%e9%95%bf%e7%ba%bf%e5%8f%99%e4%ba%8b%e7%9a%84%e7%8a%b6%e6%80%81%e6%9c%ba%ef%bc%9a%e7%94%a8%e5%89%a7%e6%83%85%e8%bf%9b%e5%ba%a6%e5%9b%be%e7%ae%a1%e7%90%86%e5%88%86%e6%94%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/87217.html","title":{"rendered":"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536"},"content":{"rendered":"<h2>\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a&#xff1a;\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536<\/h2>\n<h3>\u4e00\u3001\u957f\u7ebf\u53d9\u4e8b\u7684\u5931\u63a7&#xff1a;\u5206\u652f\u50cf\u91ce\u8349\u4e00\u6837\u75af\u957f<\/h3>\n<p>\u4e00\u4e2a\u4e3b\u7ebf\u4efb\u52a1\u4e32\u8d77\u5341\u51e0\u4e2a\u652f\u7ebf&#xff0c;\u6bcf\u4e2a\u652f\u7ebf\u53c8\u6709\u9009\u62e9&#xff0c;\u9009\u62e9\u53c8\u5f71\u54cd\u5230\u540e\u7eed\u3002\u73a9\u5bb6 A \u6551\u4e86\u7532\u3001\u73a9\u5bb6 B \u6740\u4e86\u7532&#xff0c;\u4e24\u4eba\u5728\u7b2c\u4e09\u7ae0\u9047\u5230\u7684\u4e16\u754c\u5c31\u8be5\u4e0d\u540c\u3002\u8fd9\u79cd\u957f\u7ebf\u53d9\u4e8b\u5982\u679c\u9760\u624b\u5199 if-else \u7ef4\u62a4&#xff0c;\u4ee3\u7801\u4f1a\u81a8\u80c0\u6210\u65e0\u4eba\u6562\u78b0\u7684\u6bdb\u7ebf\u56e2\u3002<\/p>\n<p>\u66f4\u9ebb\u70e6\u7684\u662f&#034;\u56de\u6536&#034;\u3002\u67d0\u652f\u7ebf\u88ab\u73a9\u5bb6\u8df3\u8fc7&#xff0c;\u76f8\u5173 NPC\u3001\u9053\u5177\u3001\u540e\u7eed\u4efb\u52a1\u90fd\u8981\u4f18\u96c5\u9000\u573a&#xff0c;\u4e0d\u80fd\u7559\u60ac\u7a7a\u5f15\u7528\u3002\u4f20\u7edf\u811a\u672c\u5e38\u5fd8\u8bb0\u6e05\u7406&#xff0c;\u5bfc\u81f4&#034;\u5df2\u6b7b\u4efb\u52a1\u8fd8\u53d1\u5956\u52b1&#034;\u7684 bug&#xff0c;\u5206\u652f\u4e0e\u56de\u6536\u662f\u957f\u7ebf\u53d9\u4e8b\u7684\u4e24\u5927\u5669\u68a6\u3002<\/p>\n<p>\u5927\u6a21\u578b\u80fd\u7ed9\u53d9\u4e8b\u751f\u6210\u7075\u6d3b\u6027&#xff0c;\u4f46\u7ed3\u6784\u4ecd\u8981\u9760\u72b6\u6001\u673a\u7ba1\u3002\u672c\u6587\u805a\u7126\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u628a\u5206\u652f\u4e0e\u56de\u6536\u5de5\u7a0b\u5316&#xff0c;\u8ba9\u957f\u7ebf\u53d9\u4e8b\u65e2\u591a\u53d8\u53c8\u53ef\u7ef4\u62a4\u3002<\/p>\n<h3>\u4e8c\u3001\u5267\u60c5\u8fdb\u5ea6\u56fe\u4e0e\u56de\u6536\u7684\u6570\u636e\u6d41<\/h3>\n<p>\u4e0b\u9762\u8fd9\u5f20\u56fe\u63cf\u8ff0\u4e86\u5267\u60c5\u8282\u70b9\u5982\u4f55\u968f\u9009\u62e9\u63a8\u8fdb\u5e76\u89e6\u53d1\u56de\u6536\u3002<\/p>\n<p>[*] \u2500\u2500&gt; Node_A<\/p>\n<p>Node_A \u2500\u2500\u6551\u7532\u2500\u2500&gt; Node_B<br \/>\nNode_A \u2500\u2500\u6740\u7532\u2500\u2500&gt; Node_C<br \/>\nNode_B \u2500\u2500&gt; Node_D<br \/>\nNode_C \u2500\u2500&gt; Node_D<br \/>\nNode_D \u2500\u2500\u652f\u7ebf\u672a\u89e6\u53d1\u2500\u2500&gt; Cleanup<\/p>\n<p>Cleanup \u5185\u90e8:<br \/>\n  [*] \u2500\u2500&gt; \u56de\u6536\u60ac\u7a7aNPC \u2500\u2500&gt; \u5173\u95ed\u76f8\u5173\u4efb\u52a1<\/p>\n<p>\u5267\u60c5\u7531\u8282\u70b9\u6784\u6210&#xff0c;\u73a9\u5bb6\u9009\u62e9\u51b3\u5b9a\u8d70\u5411&#xff08;\u6551\u7532\u6216\u6740\u7532&#xff09;&#xff0c;\u4e0d\u540c\u8def\u5f84\u6700\u7ec8\u6c47\u5230\u540e\u7eed\u8282\u70b9\u3002\u5f53\u67d0\u652f\u7ebf\u59cb\u7ec8\u672a\u89e6\u53d1&#xff0c;\u8fdb\u5165\u56de\u6536\u72b6\u6001&#xff1a;\u6e05\u7406\u5176\u60ac\u7a7a NPC\u3001\u5173\u95ed\u76f8\u5173\u4efb\u52a1&#xff0c;\u907f\u514d\u4e16\u754c\u7559\u4e0b\u65ad\u5934\u5f15\u7528\u3002<\/p>\n<p>\u8fdb\u5ea6\u56fe\u628a&#034;\u53d9\u4e8b\u903b\u8f91&#034;\u663e\u5f0f\u6210\u53ef\u904d\u5386\u7684\u7ed3\u6784&#xff0c;\u5206\u652f\u662f\u8fb9\u7684\u5206\u53c9&#xff0c;\u56de\u6536\u662f\u7279\u5b9a\u6761\u4ef6\u4e0b\u7684\u6e05\u7406\u5b50\u56fe&#xff0c;\u6ca1\u6709\u5b83&#xff0c;\u957f\u7ebf\u53d9\u4e8b\u53ea\u80fd\u9760\u6563\u843d\u7684\u6807\u5fd7\u4f4d\u786c\u6491&#xff0c;\u8d8a\u5199\u8d8a\u8106\u3002<\/p>\n<h3>\u4e09\u3001\u751f\u4ea7\u7ea7\u8fdb\u5ea6\u56fe\u4e0e\u56de\u6536\u5b9e\u73b0<\/h3>\n<p>\u4e0b\u9762\u662f\u4e00\u6bb5 Python \u793a\u4f8b&#xff0c;\u5c55\u793a\u5267\u60c5\u8282\u70b9\u63a8\u8fdb\u4e0e\u672a\u89e6\u53d1\u652f\u7ebf\u7684\u56de\u6536\u3002<\/p>\n<p>from dataclasses import dataclass, field<br \/>\nfrom typing import Callable<\/p>\n<p>&#064;dataclass<br \/>\nclass QuestNode:<br \/>\n    id: str<br \/>\n    edges: dict &#061; field(default_factory&#061;dict)   # \u9009\u62e9 -&gt; \u4e0b\u4e00\u8282\u70b9<br \/>\n    on_enter: Callable &#061; None<br \/>\n    cleanup: list &#061; field(default_factory&#061;list)  # \u8fdb\u5165\u56de\u6536\u65f6\u6267\u884c\u7684\u6e05\u7406<\/p>\n<p>class NarrativeFSM:<br \/>\n    def __init__(self):<br \/>\n        self.nodes &#061; {}<br \/>\n        self.active &#061; set()   # \u5f53\u524d\u6fc0\u6d3b\u7684\u652f\u7ebf\u8282\u70b9<br \/>\n    def add(self, n: QuestNode):<br \/>\n        self.nodes[n.id] &#061; n<br \/>\n    def choose(self, cur: str, choice: str):<br \/>\n        nxt &#061; self.nodes[cur].edges.get(choice)<br \/>\n        if nxt:<br \/>\n            self.nodes[nxt].on_enter and self.nodes[nxt].on_enter()<br \/>\n            self.active.add(nxt)<br \/>\n    def reclaim(self, triggered: set):<br \/>\n        # \u672a\u89e6\u53d1\u7684\u652f\u7ebf\u8282\u70b9\u6267\u884c\u56de\u6536&#xff0c;\u6e05\u7406\u60ac\u7a7a\u5f15\u7528<br \/>\n        for nid in list(self.active):<br \/>\n            if nid not in triggered:<br \/>\n                for fn in self.nodes[nid].cleanup:<br \/>\n                    fn()<br \/>\n                self.active.discard(nid)<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u7684\u5173\u952e\u5951\u7ea6&#xff1a;\u5267\u60c5\u8282\u70b9\u7528\u8fb9\u8868\u8868\u8fbe\u5206\u652f\u3001\u7528 cleanup \u5217\u8868\u767b\u8bb0\u56de\u6536\u52a8\u4f5c&#xff0c;\u4f7f&#034;\u5206\u652f\u5f80\u54ea\u8d70\u3001\u4e0d\u8d70\u4e86\u600e\u4e48\u6536&#034;\u90fd\u663e\u5f0f\u53ef\u67e5&#xff1b;reclaim \u904d\u5386\u6fc0\u6d3b\u652f\u7ebf&#xff0c;\u5bf9\u672a\u89e6\u53d1\u7684\u6267\u884c\u6e05\u7406\u5e76\u79fb\u51fa\u6fc0\u6d3b\u96c6&#xff0c;\u675c\u7edd\u60ac\u7a7a\u5f15\u7528\u3002\u751f\u4ea7\u73af\u5883\u5e94\u628a on_enter \u4e0e cleanup \u6301\u4e45\u5316\u5230\u5b58\u6863&#xff0c;\u91cd\u8fdb\u6e38\u620f\u80fd\u91cd\u5efa\u72b6\u6001&#xff0c;\u56de\u6536\u8981\u5728\u5b89\u5168\u70b9\u89e6\u53d1&#xff08;\u5982\u7ae0\u8282\u5207\u6362&#xff09;&#xff0c;\u907f\u514d\u6218\u6597\u4e2d\u7a81\u7136\u64a4 NPC \u51fa\u620f\u3002\u8282\u70b9\u56fe\u5e94\u7531\u7b56\u5212\u5de5\u5177\u53ef\u89c6\u5316\u7f16\u8f91&#xff0c;\u522b\u8ba9\u811a\u672c\u76f4\u63a5\u5199\u6b7b\u8fb9\u8868&#xff0c;\u5426\u5219\u957f\u7ebf\u7ef4\u62a4\u4ecd\u4f1a\u5931\u63a7\u3002<\/p>\n<h3>\u56db\u3001\u72b6\u6001\u7206\u70b8\u3001\u5b58\u6863\u4e0e\u56de\u653e\u7684\u8fb9\u754c<\/h3>\n<p>\u8fdb\u5ea6\u56fe\u7684\u6700\u5927\u98ce\u9669\u662f\u72b6\u6001\u7206\u70b8&#xff0c;\u9009\u62e9\u7ec4\u5408\u4e00\u591a&#xff0c;\u8282\u70b9\u4e0e\u8fb9\u6307\u6570\u589e\u957f&#xff0c;\u7b56\u5212\u6765\u4e0d\u53ca\u586b\u5185\u5bb9\u3002\u9700\u514b\u5236\u5206\u53c9\u6df1\u5ea6&#xff0c;\u628a&#034;\u4f2a\u5206\u652f&#034;&#xff08;\u53ea\u662f\u53f0\u8bcd\u4e0d\u540c\u3001\u4e0d\u5f71\u54cd\u4e16\u754c&#xff09;\u4e0e&#034;\u771f\u5206\u652f&#034;&#xff08;\u6539\u53d8\u540e\u7eed&#xff09;\u5206\u5f00&#xff0c;\u53ea\u5bf9\u771f\u5206\u652f\u5efa\u8282\u70b9&#xff0c;\u4f2a\u5206\u652f\u7528\u6587\u672c\u5c42\u5904\u7406\u3002<\/p>\n<p>\u5b58\u6863\u662f\u957f\u7ebf\u53d9\u4e8b\u7684\u786c\u9700\u6c42&#xff0c;\u73a9\u5bb6\u9000\u51fa\u518d\u8fdb&#xff0c;\u5267\u60c5\u72b6\u6001\u987b\u7cbe\u786e\u8fd8\u539f\u3002\u8fdb\u5ea6\u56fe\u7684\u6fc0\u6d3b\u96c6\u3001\u5404\u8282\u70b9\u6807\u5fd7\u90fd\u8981\u5e8f\u5217\u5316&#xff0c;\u6f0f\u5b58\u4e00\u4e2a\u6807\u5fd7\u5c31\u53ef\u80fd\u8ba9\u5267\u60c5\u9519\u4f4d\u3002\u5b58\u6863\u683c\u5f0f\u8981\u5411\u524d\u517c\u5bb9&#xff0c;\u65e7\u6863\u8bfb\u65b0\u7248\u672c\u4e0d\u80fd\u5d29\u3002<\/p>\n<p>\u56de\u653e\u4e0e\u8c03\u8bd5\u56f0\u96be\u3002\u53d9\u4e8b bug \u5e38\u662f&#034;\u73a9\u5230\u7b2c\u4e09\u7ae0\u624d\u53d1\u73b0\u5176\u4e00\u662f\u7ae0\u67d0\u9009\u62e9\u6ca1\u751f\u6548&#034;&#xff0c;\u96be\u4ee5\u590d\u73b0\u3002\u9700\u8bb0\u5f55\u73a9\u5bb6\u5173\u952e\u9009\u62e9\u7684\u65f6\u5e8f\u65e5\u5fd7&#xff0c;\u652f\u6301\u8df3\u8f6c\u5230\u7279\u5b9a\u8282\u70b9\u72b6\u6001\u8c03\u8bd5\u3002\u957f\u7ebf\u53d9\u4e8b\u56e0\u6b64\u65e2\u662f\u5185\u5bb9\u5de5\u7a0b\u4e5f\u662f\u72b6\u6001\u5de5\u7a0b&#xff0c;\u5206\u652f\u4e0e\u56de\u6536\u53ea\u662f\u8868\u8c61&#xff0c;\u80cc\u540e\u662f\u6574\u5957\u53ef\u5e8f\u5217\u5316\u3001\u53ef\u8c03\u8bd5\u7684\u72b6\u6001\u7ba1\u7406\u3002\u8f7b\u89c6\u8fd9\u5c42&#xff0c;\u53d9\u4e8b\u518d\u7cbe\u5f69\u4e5f\u4f1a\u5728\u540e\u671f\u788e\u6210 bug \u6d77\u3002<\/p>\n<h3>\u7ed3\u8bba<\/h3>\n<p>\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a&#xff0c;\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u628a\u5206\u652f\u8868\u8fbe\u4e3a\u8282\u70b9\u8fb9\u3001\u628a\u56de\u6536\u8868\u8fbe\u4e3a\u6e05\u7406\u5b50\u56fe&#xff0c;\u4f7f\u591a\u53d8\u53d9\u4e8b\u65e2\u7075\u6d3b\u53c8\u53ef\u7ef4\u62a4\u3002\u8282\u70b9\u7528\u8fb9\u8868\u8bb0\u5206\u652f\u3001cleanup \u5217\u8868\u767b\u8bb0\u56de\u6536&#xff0c;\u672a\u89e6\u53d1\u652f\u7ebf\u7ecf reclaim \u6e05\u7406\u60ac\u7a7a\u5f15\u7528\u9632\u65ad\u5934 bug\u3002\u5de5\u7a0b\u843d\u5730\u987b\u5c06 on_enter \u4e0e cleanup \u6301\u4e45\u5316\u5230\u5b58\u6863\u3001\u5728\u5b89\u5168\u70b9\u89e6\u53d1\u56de\u6536\u9632\u51fa\u620f&#xff0c;\u5e76\u7531\u53ef\u89c6\u5316\u5de5\u5177\u7f16\u8f91\u8282\u70b9\u907f\u514d\u811a\u672c\u5199\u6b7b&#xff1b;\u540c\u65f6\u628a\u4f2a\u5206\u652f\u4e0e\u771f\u5206\u652f\u5206\u5c42\u3001\u7528\u9009\u62e9\u65f6\u5e8f\u65e5\u5fd7\u652f\u6301\u8df3\u6001\u8c03\u8bd5\u3002\u957f\u7ebf\u53d9\u4e8b\u662f\u5185\u5bb9\u5de5\u7a0b\u66f4\u662f\u72b6\u6001\u5de5\u7a0b&#xff0c;\u5206\u652f\u4e0e\u56de\u6536\u80cc\u540e\u662f\u6574\u5957\u53ef\u5e8f\u5217\u5316\u3001\u53ef\u8c03\u8bd5\u7684\u72b6\u6001\u7ba1\u7406&#xff0c;\u8f7b\u89c6\u5b83\u53d9\u4e8b\u518d\u7cbe\u5f69\u4e5f\u4f1a\u5728\u540e\u671f\u5d29\u4e8e\u7ec6\u8282\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a&#xff1a;\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536<br \/>\n\u4e00\u3001\u957f\u7ebf\u53d9\u4e8b\u7684\u5931\u63a7&#xff1a;\u5206\u652f\u50cf\u91ce\u8349\u4e00\u6837\u75af\u957f<br \/>\n\u4e00\u4e2a\u4e3b\u7ebf\u4efb\u52a1\u4e32\u8d77\u5341\u51e0\u4e2a\u652f\u7ebf&#xff0c;\u6bcf\u4e2a\u652f\u7ebf\u53c8\u6709\u9009\u62e9&#xff0c;\u9009\u62e9\u53c8\u5f71\u54cd\u5230\u540e\u7eed\u3002\u73a9\u5bb6 A \u6551\u4e86\u7532\u3001\u73a9\u5bb6 B \u6740\u4e86\u7532&#xff0c;\u4e24\u4eba\u5728\u7b2c\u4e09\u7ae0\u9047\u5230\u7684\u4e16\u754c\u5c31\u8be5\u4e0d\u540c\u3002\u8fd9\u79cd\u957f\u7ebf\u53d9\u4e8b\u5982\u679c\u9760\u624b\u5199 if-else \u7ef4\u62a4&#xff0c;\u4ee3\u7801\u4f1a\u81a8\u80c0\u6210\u65e0\u4eba\u6562\u78b0\u7684\u6bdb\u7ebf\u56e2\u3002<br \/>\n\u66f4\u9ebb\u70e6\u7684\u662f\\&#8221;\u56de\u6536\\&#8221;\u3002\u67d0\u652f\u7ebf\u88ab\u73a9\u5bb6\u8df3\u8fc7&#xff0c;\u76f8\u5173 NPC\u3001\u9053\u5177\u3001\u540e\u7eed\u4efb\u52a1\u90fd\u8981\u4f18\u96c5\u9000\u573a&amp;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50],"topic":[],"class_list":["post-87217","post","type-post","status-publish","format-standard","hentry","category-server","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/87217.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a&#xff1a;\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 \u4e00\u3001\u957f\u7ebf\u53d9\u4e8b\u7684\u5931\u63a7&#xff1a;\u5206\u652f\u50cf\u91ce\u8349\u4e00\u6837\u75af\u957f \u4e00\u4e2a\u4e3b\u7ebf\u4efb\u52a1\u4e32\u8d77\u5341\u51e0\u4e2a\u652f\u7ebf&#xff0c;\u6bcf\u4e2a\u652f\u7ebf\u53c8\u6709\u9009\u62e9&#xff0c;\u9009\u62e9\u53c8\u5f71\u54cd\u5230\u540e\u7eed\u3002\u73a9\u5bb6 A \u6551\u4e86\u7532\u3001\u73a9\u5bb6 B \u6740\u4e86\u7532&#xff0c;\u4e24\u4eba\u5728\u7b2c\u4e09\u7ae0\u9047\u5230\u7684\u4e16\u754c\u5c31\u8be5\u4e0d\u540c\u3002\u8fd9\u79cd\u957f\u7ebf\u53d9\u4e8b\u5982\u679c\u9760\u624b\u5199 if-else \u7ef4\u62a4&#xff0c;\u4ee3\u7801\u4f1a\u81a8\u80c0\u6210\u65e0\u4eba\u6562\u78b0\u7684\u6bdb\u7ebf\u56e2\u3002 \u66f4\u9ebb\u70e6\u7684\u662f&quot;\u56de\u6536&quot;\u3002\u67d0\u652f\u7ebf\u88ab\u73a9\u5bb6\u8df3\u8fc7&#xff0c;\u76f8\u5173 NPC\u3001\u9053\u5177\u3001\u540e\u7eed\u4efb\u52a1\u90fd\u8981\u4f18\u96c5\u9000\u573a&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/87217.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-29T18:32:21+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87217.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/87217.html\",\"name\":\"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-29T18:32:21+00:00\",\"dateModified\":\"2026-07-29T18:32:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/87217.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/87217.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87217.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/87217.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a&#xff1a;\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 \u4e00\u3001\u957f\u7ebf\u53d9\u4e8b\u7684\u5931\u63a7&#xff1a;\u5206\u652f\u50cf\u91ce\u8349\u4e00\u6837\u75af\u957f \u4e00\u4e2a\u4e3b\u7ebf\u4efb\u52a1\u4e32\u8d77\u5341\u51e0\u4e2a\u652f\u7ebf&#xff0c;\u6bcf\u4e2a\u652f\u7ebf\u53c8\u6709\u9009\u62e9&#xff0c;\u9009\u62e9\u53c8\u5f71\u54cd\u5230\u540e\u7eed\u3002\u73a9\u5bb6 A \u6551\u4e86\u7532\u3001\u73a9\u5bb6 B \u6740\u4e86\u7532&#xff0c;\u4e24\u4eba\u5728\u7b2c\u4e09\u7ae0\u9047\u5230\u7684\u4e16\u754c\u5c31\u8be5\u4e0d\u540c\u3002\u8fd9\u79cd\u957f\u7ebf\u53d9\u4e8b\u5982\u679c\u9760\u624b\u5199 if-else \u7ef4\u62a4&#xff0c;\u4ee3\u7801\u4f1a\u81a8\u80c0\u6210\u65e0\u4eba\u6562\u78b0\u7684\u6bdb\u7ebf\u56e2\u3002 \u66f4\u9ebb\u70e6\u7684\u662f\"\u56de\u6536\"\u3002\u67d0\u652f\u7ebf\u88ab\u73a9\u5bb6\u8df3\u8fc7&#xff0c;\u76f8\u5173 NPC\u3001\u9053\u5177\u3001\u540e\u7eed\u4efb\u52a1\u90fd\u8981\u4f18\u96c5\u9000\u573a&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/87217.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-29T18:32:21+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/87217.html","url":"https:\/\/www.wsisp.com\/helps\/87217.html","name":"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-29T18:32:21+00:00","dateModified":"2026-07-29T18:32:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/87217.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/87217.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/87217.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6e38\u620f\u5185\u957f\u7ebf\u53d9\u4e8b\u7684\u72b6\u6001\u673a\uff1a\u7528\u5267\u60c5\u8fdb\u5ea6\u56fe\u7ba1\u7406\u5206\u652f\u4e0e\u56de\u6536"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=87217"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87217\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=87217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=87217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=87217"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=87217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}