加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

为C编写,阅读和使用专用数据文件

发布时间:2020-12-16 07:09:58 所属栏目:百科 来源:网络整理
导读:我正在研究一个C项目和我需要做的部分工作,使它能够读取多个数据文件以提取名称,描述和选择它的要求,其中可能包括选择了以前的数据文件.该程序本质上是一个Pathfinder角色创建者和数据文件或壮举.我希望人们可以轻松地将新功能添加到列表中,这就是为什么我希
我正在研究一个C项目和我需要做的部分工作,使它能够读取多个数据文件以提取名称,描述和选择它的要求,其中可能包括选择了以前的数据文件.该程序本质上是一个Pathfinder角色创建者和数据文件或壮举.我希望人们可以轻松地将新功能添加到列表中,这就是为什么我希望每个功能都是独立的,我需要它们大部分都是简单的语言,以便有人可以查看其中一个文件,并且大多数人都知道要做什么.

遗憾的是,到目前为止,我所拥有的C资源都没有以这种方式读取文件,也没有我能用它做什么语言.对于我来说,完成这项工作有什么好的语言,如何从该文件类型中获取数据?这是一个可用于演示的示例专长:

Name: Greater Blind-Fight

Prerequisites: Perception 15 (this will be a variable I’d need it to check that it’s 15 or higher),Improved Blind-Fight (this is another feat I’d need to make sure was selected)

Benefit: Your melee attacks ignore the miss chance for less than total concealment,and you treat opponents with total concealment as if they had normal concealment (20% miss chance instead of 50%). You may still reroll a miss chance percentile roll as normal.

If you successfully pinpoint an invisible or hidden attacker,that attacker gets no advantages related to hitting you with ranged attacks,regardless of the range. That is,you don’t lose your Dexterity bonus to Armor Class,and the attacker doesn’t get the usual +2 bonus for being invisible.

(may end up being written in a manner that affects other variables)

Special: The Greater Blind-Fight feat is of no use against a character who is the subject of a blink spell.

如果它不能以人们可以快速添加新文件的方式做得很好,那很好,那就是我想要做的事情,而不是绝对必要的,只是我刚开始使用C和as我说,我的资源完全跳过了这种事情.

解决方法

有很多人类可读/可写数据格式,每种主要编程语言都有绑定,有些示例的基本示例如下:

> XML

<character>
   <name>foobar</name>
   <abilities>
        <ability>
            <name>perception</name>
            <value>15</value>
        </ability>
    </abilities>
</character>

> YAML

name: foobar
abilities:
   - perception: 15
   - ...

官方YAML site上有一个实现列表,顺便说一下YAML.
> JSON

{
    "name": "foobar","abilities": {
        "perception": 15
    }
}

请注意,数据格式不实现您的逻辑.如果percpetion> = 15意味着盲目战斗你总是需要自己做.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读