added parandra; code refactoring
This commit is contained in:
parent
13211b5e9d
commit
e56b98d5de
13 changed files with 336 additions and 224 deletions
18
Makefile.in
18
Makefile.in
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -459,16 +459,14 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
|||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
if (etags --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
test -f $$subdir/TAGS && \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
|
@ -478,11 +476,9 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
@ -594,7 +590,7 @@ distcheck: dist
|
|||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
|
|
15
aclocal.m4
vendored
15
aclocal.m4
vendored
|
@ -1,4 +1,4 @@
|
|||
# generated automatically by aclocal 1.8.5 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.8.3 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
# Free Software Foundation, Inc.
|
||||
|
@ -40,7 +40,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"])
|
|||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.8.5])])
|
||||
[AM_AUTOMAKE_VERSION([1.8.3])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND
|
||||
|
||||
|
@ -266,14 +266,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
|
|||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
# (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored.
|
||||
if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
|
|
22
data/units/Elvish_Lady.cfg
Normal file
22
data/units/Elvish_Lady.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
#unit used for the Elvish Lady in Heir to the Throne
|
||||
[unit]
|
||||
id=Elvish Lady Parandra
|
||||
name= _ "Elvish Lady"
|
||||
image=parandra.png
|
||||
hitpoints=30
|
||||
movement_type=fly
|
||||
movement=6
|
||||
experience=30
|
||||
level=3
|
||||
alignment=neutral
|
||||
advanceto=null
|
||||
cost=10
|
||||
usage=null
|
||||
[attack]
|
||||
name=dummy
|
||||
type=impact
|
||||
range=short
|
||||
damage=1
|
||||
number=1
|
||||
[/attack]
|
||||
[/unit]
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -1148,16 +1148,14 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
if (etags --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
test -f $$subdir/TAGS && \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
|
@ -1167,11 +1165,9 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
|
|
@ -449,7 +449,7 @@ const file_tree_checksum& data_tree_checksum()
|
|||
static file_tree_checksum checksum;
|
||||
if(checksum.nfiles == 0) {
|
||||
get_file_tree_checksum_internal("data/",checksum);
|
||||
get_file_tree_checksum_internal(get_user_data_dir() + "data/",checksum);
|
||||
get_file_tree_checksum_internal(get_user_data_dir() + "/data/",checksum);
|
||||
std::cerr << "calculated data tree checksum: "
|
||||
<< checksum.nfiles << " files; "
|
||||
<< checksum.sum_size << " bytes\n";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -510,11 +510,9 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -626,11 +626,9 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
|
|
@ -524,6 +524,10 @@ unit_type::unit_type(const unit_type& o)
|
|||
{
|
||||
gender_types_[0] = o.gender_types_[0] != NULL ? new unit_type(*o.gender_types_[0]) : NULL;
|
||||
gender_types_[1] = o.gender_types_[1] != NULL ? new unit_type(*o.gender_types_[1]) : NULL;
|
||||
|
||||
for(variations_map::const_iterator i = o.variations_.begin(); i != o.variations_.end(); ++i) {
|
||||
variations_[i->first] = new unit_type(*i->second);
|
||||
}
|
||||
}
|
||||
|
||||
unit_type::unit_type(const config& cfg, const movement_type_map& mv_types,
|
||||
|
@ -532,7 +536,7 @@ unit_type::unit_type(const config& cfg, const movement_type_map& mv_types,
|
|||
{
|
||||
const config::child_list& variations = cfg.get_children("variation");
|
||||
for(config::child_list::const_iterator var = variations.begin(); var != variations.end(); ++var) {
|
||||
variations_.insert(std::pair<std::string,unit_type>((**var)["variation_name"],unit_type(**var,mv_types,races,traits)));
|
||||
variations_.insert(std::pair<std::string,unit_type*>((**var)["variation_name"],new unit_type(**var,mv_types,races,traits)));
|
||||
}
|
||||
|
||||
gender_types_[0] = NULL;
|
||||
|
@ -621,6 +625,10 @@ unit_type::~unit_type()
|
|||
{
|
||||
delete gender_types_[unit_race::MALE];
|
||||
delete gender_types_[unit_race::FEMALE];
|
||||
|
||||
for(variations_map::iterator i = variations_.begin(); i != variations_.end(); ++i) {
|
||||
delete i->second;
|
||||
}
|
||||
}
|
||||
|
||||
const unit_type& unit_type::get_gender_unit_type(unit_race::GENDER gender) const
|
||||
|
@ -635,9 +643,9 @@ const unit_type& unit_type::get_gender_unit_type(unit_race::GENDER gender) const
|
|||
|
||||
const unit_type& unit_type::get_variation(const std::string& name) const
|
||||
{
|
||||
const std::map<std::string,unit_type>::const_iterator i = variations_.find(name);
|
||||
const variations_map::const_iterator i = variations_.find(name);
|
||||
if(i != variations_.end()) {
|
||||
return i->second;
|
||||
return *i->second;
|
||||
} else {
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -246,7 +246,8 @@ private:
|
|||
|
||||
unit_type* gender_types_[2];
|
||||
|
||||
std::map<std::string,unit_type> variations_;
|
||||
typedef std::map<std::string,unit_type*> variations_map;
|
||||
variations_map variations_;
|
||||
|
||||
const config& cfg_;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.8.5 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -491,11 +491,9 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
|
Loading…
Add table
Reference in a new issue