Aller au contenu

Photo

Future


  • Veuillez vous connecter pour répondre
31 réponses à ce sujet

#26
Guest_TrillClinton_*

Guest_TrillClinton_*
  • Guests

A pointer of an abstract class should not change anything with the templates actually.

 

When you use <T>, what happens is that T generates a class at compile with type T. This T can be anything basically, the Race* should be able to work.

 

Lets take it for example your race is dwarf and your variable is initialized as R *dwarf;

 

dwarf->getRace(); will be able to get dwarf as long as it is virtual through V-tables.



#27
virusman

virusman
  • Members
  • 282 messages

When you use <T>, what happens is that T generates a class at runtime with type T. This T can be anything basically, the Race* should be able to work.

Compile time, not runtime.



#28
Guest_TrillClinton_*

Guest_TrillClinton_*
  • Guests

Compile time, not runtime.

 

 

Ah yes I made a mistake with that.

 

Virtual functions are runtime, template classes are compile time.



#29
RedConfusion

RedConfusion
  • Members
  • 8 messages

@DrMcCoy:

 

About building process: it seems to be possible to cross compile to windows with cmake. Setting the cross compiling variables I was able to generate a win file (with the wrong name!):

$ file _build/libd20.so
_build/libd20.so: PE32 executable (DLL) (console) Intel 80386 (stripped to external PDB), for MS Windows

However, I'm quite sure you have more experience than me on cpp, thus if you feel like changing cmake for custom scripts or whatever you think is best, I'll gladly accept!

 

About C++11 version: I think it is fine to ignore some old portable video games, and apple now releases its op for free. I have the lastest macos running on a macbook white. So I think we will be fine cutting support for old macos - we gain a better code and avoid a possible migration in the next years! The jump from c++11 to c++14 seems smaller compared to the previous ones.

 

 

I don't think having singletons to represent the classes and races is such a good idea, to be honest.

 

Can you elaborate? Don't forget I'm rusty on cpp!

 

I fixed the tabs, getters and setters and add a license. Thanks!

 

@TuringComplete

 

Ah, I see! I was avoiding using templates because of the compiling time and the cryptical error messages. But this might be related to my lack of experience. Maybe I should switch to a template? Will give a try. But now what is bugging me is the singleton thing.

 

@virusman:

 

I'm your fan. Thanks for maintain nwnx2!



#30
Guest_TrillClinton_*

Guest_TrillClinton_*
  • Guests

@TuringComplete

 

Ah, I see! I was avoiding using templates because of the compiling time and the cryptical error messages. But this might be related to my lack of experience. Maybe I should switch to a template? Will give a try. But now what is bugging me is the singleton thing.

 

 

 

I don' think you should use templates for this. Only if it makes sense in the design. I only use templates when the class I am making can define a wide range of operations. Example is a binary tree. BinaryTree<T> the T would represent the different type of elements that can be maintained in the binary tree.

 

The map is already implemented as a template if I am not mistaken, so as long as you plug in the value that would be generated at compile time it is fine. Also, inheritance is fine but for game systems use composition if you can. It just makes it easier to work with. Use inheritance when you are sure that you can get a benefit from it. Inhertiance can cause a mess at times



#31
Lazarus Magni

Lazarus Magni
  • Members
  • 1 134 messages

It's interesting to note that games like GTA, and final fantsy are coming out for smart phones, and tablets... Wonder if NWN will someday?



#32
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages

It's interesting to note that games like GTA, and final fantsy are coming out for smart phones, and tablets... Wonder if NWN will someday?

 

Doubtful it'll be ported to Android but it does seem to run on Windows tablets just fine.  KotOR (which uses an engine very, very similar to NWN's) was ported to iOS recently so at least some (type of) portability is there.  Because of the NWN MMO and because of the sign-offs (from both EA and WotC) required to do anything with NWN, any type of NWN anything is likely a few years away.  That's per Trent Oster, who's been pestered about it quite a bit since this last summer and who has responded about the issue in a lot of different mediums.  Still, one never knows what the future holds.