[Commits] [wesnoth/wesnoth] f69481: add parse method and static name method to MAKE_EN...

GitHub noreply at github.com
Fri Jun 5 15:34:58 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: f69481d26f6d34706046fa4e3dd58ef87358dd2d
      https://github.com/wesnoth/wesnoth/commit/f69481d26f6d34706046fa4e3dd58ef87358dd2d
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2015-06-05 (Fri, 05 Jun 2015)

  Changed paths:
    M src/make_enum.hpp
    M src/tests/test_make_enum.cpp

  Log Message:
  -----------
  add parse method and static name method to MAKE_ENUM

enum.parse("str"); tries convert "str" to an enum and sets enum to "str"
on success. Returns true on success otherwise false. This is useful
because string_to_enum always throws an exception on failure which is
slow if failue is not that unlikeley.

enumtype::name(); returns "enumname" (the name of the type). This is
intended for debugging.


  Commit: 5d617b9e4f2729fdf252811837f3593e48eeb7c8
      https://github.com/wesnoth/wesnoth/commit/5d617b9e4f2729fdf252811837f3593e48eeb7c8
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2015-06-05 (Fri, 05 Jun 2015)

  Changed paths:
    M src/menu_events.cpp

  Log Message:
  -----------
  Allow string identifers in :control

:control now also accepts a string as first parameter in this case it
searches for a side with save_id matching this string. So for example In
LoW you can now use ':controller Kalenz gfgtdf' insetead of ':controller
1 gfgtdf'


Compare: https://github.com/wesnoth/wesnoth/compare/b4b7a3656fad...5d617b9e4f27


More information about the Commits mailing list