Page 1 of 1
Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 11:28
by slogic
I have looked into Spring master source code and haven't found any GetShortModName() API function. Does it mean GetModName() body will be changed? I wanna be sure, because i definitely want to avoid AAI's problems when config file is not found for brand new mod version.
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 12:19
by hoijui
added
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 13:37
by slogic
Thank you. I really appreciate your work though i can't provide you a desired harem. Only improved versions of AI

Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 13:56
by hoijui
:D
well.. as you possibly saw, with the recent changes, it is now not a lot of work anymore, to put one function into the legacy wrapper, if it is already in the C Interface.
last weekend was a good one for me. even doh i did not meet a harem, it was good (i met some real people, most of which i had not seen before, and there were 50% girls! :O )
i tried compiling latest E323AI master on spring master under linux, and got these compile errors:
Code: Select all
In file included from AI/Skirmish/E323AI/Util.cpp:10:
AI/Skirmish/E323AI/Util.hpp: In function 'std::set<T, std::less<_Key>, std::allocator<_CharT> > util::IntersectSets(const std::set<T, std::less<_Key>, std::allocator<_CharT> >&, const std::set<T, std::less<_Key>, std::allocator<_CharT> >&)':
AI/Skirmish/E323AI/Util.hpp:39: error: expected `;' before 'sit'
AI/Skirmish/E323AI/Util.hpp:41: error: 'sit' was not declared in this scope
AI/Skirmish/E323AI/Util.hpp: In function 'void util::GetShuffledKeys(std::vector<Key, std::allocator<_CharT> >&, std::map<Key, T, std::less<_Key>, std::allocator<std::pair<const _Key, _Tp> > >&)':
AI/Skirmish/E323AI/Util.hpp:62: error: expected `;' before 'it'
AI/Skirmish/E323AI/Util.hpp:63: error: 'it' was not declared in this scope
In file included from AI/Skirmish/E323AI/CLogger.cpp:11:
AI/Skirmish/E323AI/Util.hpp: In function 'std::set<T, std::less<_Key>, std::allocator<_CharT> > util::IntersectSets(const std::set<T, std::less<_Key>, std::allocator<_CharT> >&, const std::set<T, std::less<_Key>, std::allocator<_CharT> >&)':
AI/Skirmish/E323AI/Util.hpp:39: error: expected `;' before 'sit'
AI/Skirmish/E323AI/Util.hpp:41: error: 'sit' was not declared in this scope
AI/Skirmish/E323AI/Util.hpp: In function 'void util::GetShuffledKeys(std::vector<Key, std::allocator<_CharT> >&, std::map<Key, T, std::less<_Key>, std::allocator<std::pair<const _Key, _Tp> > >&)':
AI/Skirmish/E323AI/Util.hpp:62: error: expected `;' before 'it'
AI/Skirmish/E323AI/Util.hpp:63: error: 'it' was not declared in this scope
In file included from AI/Skirmish/E323AI/CUnitTable.cpp:11:
AI/Skirmish/E323AI/Util.hpp: In function 'std::set<T, std::less<_Key>, std::allocator<_Tp1> > util::IntersectSets(const std::set<T, std::less<_Key>, std::allocator<_Tp1> >&, const std::set<T, std::less<_Key>, std::allocator<_Tp1> >&)':
AI/Skirmish/E323AI/Util.hpp:39: error: expected `;' before 'sit'
AI/Skirmish/E323AI/Util.hpp:41: error: 'sit' was not declared in this scope
AI/Skirmish/E323AI/Util.hpp: In function 'void util::GetShuffledKeys(std::vector<_Tp, std::allocator<_Tp1> >&, std::map<Key, T, std::less<_Key>, std::allocator<std::pair<const _Key, _Tp> > >&)':
AI/Skirmish/E323AI/Util.hpp:62: error: expected `;' before 'it'
AI/Skirmish/E323AI/Util.hpp:63: error: 'it' was not declared in this scope
sorry, i know this is not the best place to put it, but i am lazy right now

i have never used C++ generics/templates or what it is called, have no idea what could be the problem here.
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 14:05
by slogic
LOL, i've just put LF after "template<typename T>".
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 14:19
by hoijui
i tired removing that, but it did not help.
the template stuff seems to work in general, only fails for set::const_iterator ans set::iterator.
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 16:00
by slogic
Comment it out temporarily. Leave RemoveWhiteSpaceInPlace(), GetAbsFileName() and GetShuffledKeys().
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 16:39
by hoijui
i fixed it (and committed to your repo).
the solution is.. well... C++ live!
i had to change this:
to this:
Re: Getting short mod name via Legacy CPP interface
Posted: 18 May 2010, 18:02
by slogic
T is already typenamed: template<typename T>. Strange. I expected the source of this problem is GetShuffledKeys() only.