Getting short mod name via Legacy CPP interface

Getting short mod name via Legacy CPP interface

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Getting short mod name via Legacy CPP interface

Post 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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Getting short mod name via Legacy CPP interface

Post by hoijui »

added
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Getting short mod name via Legacy CPP interface

Post by slogic »

Thank you. I really appreciate your work though i can't provide you a desired harem. Only improved versions of AI :mrgreen:
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Getting short mod name via Legacy CPP interface

Post 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.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Getting short mod name via Legacy CPP interface

Post by slogic »

LOL, i've just put LF after "template<typename T>".
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Getting short mod name via Legacy CPP interface

Post 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.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Getting short mod name via Legacy CPP interface

Post by slogic »

Comment it out temporarily. Leave RemoveWhiteSpaceInPlace(), GetAbsFileName() and GetShuffledKeys().
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Getting short mod name via Legacy CPP interface

Post by hoijui »

i fixed it (and committed to your repo).
the solution is.. well... C++ live!
i had to change this:

Code: Select all

std:set<T>::iterator it;
to this:

Code: Select all

typename std:set<T>::iterator it;
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Getting short mod name via Legacy CPP interface

Post by slogic »

T is already typenamed: template<typename T>. Strange. I expected the source of this problem is GetShuffledKeys() only.
Post Reply

Return to “AI”