Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
W
windbot
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Packages
    • Packages
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issues
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • MyCard
  • windbot
  • Wiki
  • 如何编写你自己的WindBot AI

如何编写你自己的WindBot AI

Last edited by Mercury233 May 29, 2018
Page history
This is an old version of this page. You can view the most recent version or browse the history.

WindBot用C#开发。C#比较易于使用,因此编写一个AI并不困难。本文以编写一个光道卡组为例,介绍编写WindBot AI的方法。

准备工作

  • Visual Studio
    在VS2015上测试通过,VS2010理论上可用.
  • 基本的编程基础
    变量、函数、类、对象、数组、if、for、while之类的基础知识。
  • 基本的YGOPro知识
    不会打牌也想教AI打牌?

开始吧

1. 组一个卡组

image

(我不会玩光道,这是我乱组的)

卡组以易用为优先。一张卡的用法越多,写AI就越难。

把ydk文件命名为AI_Lightsworn,放到windbot的decks文件夹里。

2. 创建Executor

Executor(与Java的那个无关)是执行者的意思,用来给每个卡组规定每张卡片的用法等。

在Game\AI\Decks下新建代码文件,命名为LightswornExecutor。 在其中写以下代码:

using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;

namespace WindBot.Game.AI.Decks
{
    [Deck("Lightsworn", "AI_Lightsworn")]
    public class LightswornExecutor : DefaultExecutor
    {

        public LightswornExecutor(GameAI ai, Duel duel)
            : base(ai, duel)
        {

        }

    }
}

可以看到,在WindBot.Game.AI.Decks下新建的LightswornExecutor继承了DefaultExecutor。

Clone repository
  • Home
  • Running Windbot
  • 如何编写你自己的WindBot AI
More Pages