FreeKill/lua/core
Rintim 04f1009075
Provide hasMark methods (#180)
It provides two methods `Player:hasMark` and `Card:hasMark` for
determining if the player/card has the mark, which is more expressive
than `xxx:getMark` when only checking for the existence.

By the way, xxx:hasMark may directly determine a `Mark` in xxx.mark, for
which I added `table:hasKey` method in `util.lua`, but currently the
code still checks if the result of `xxx:getMark` is not 0.

---


提供了`Player:hasMark`和`Card:hasMark`两个方法,用于在只需要判断是否有标记时可以直接使用`xxx:hasMark`,相比使用`xxx:getMark`而言更加表达代码的作用。


顺带一提,`xxx:hasMark`应该可以直接判断`Mark`是否在`xxx.mark`里,我在`util.lua`里添加了`table:hasKey`的方法用于判断,但目前的代码还是判断`xxx:getMark`的结果是否不为0。
2023-06-09 17:23:24 +08:00
..
card_type Spdx license (#109) 2023-04-09 13:35:35 +08:00
skill_type Enhancement (#170) 2023-06-04 19:39:20 +08:00
card.lua Provide hasMark methods (#180) 2023-06-09 17:23:24 +08:00
debug.lua Pattern (#129) 2023-04-21 04:29:52 +08:00
engine.lua player_doc更新 (#168) 2023-06-03 23:59:04 +08:00
exppattern.lua Pattern (#129) 2023-04-21 04:29:52 +08:00
game_mode.lua core_doc_20230412_0844 (#113) 2023-04-12 13:28:01 +08:00
general.lua Recorder (#178) 2023-06-09 01:10:16 +08:00
package.lua Spdx license (#109) 2023-04-09 13:35:35 +08:00
player.lua Provide hasMark methods (#180) 2023-06-09 17:23:24 +08:00
skill.lua player_doc更新 (#168) 2023-06-03 23:59:04 +08:00
util.lua Recorder (#178) 2023-06-09 01:10:16 +08:00