C++ konstruktor tablic i vektor.
Ostatnio zmodyfikowano 2014-10-18 14:49
Jacahehe Temat założony przez niniejszego użytkownika |
C++ konstruktor tablic i vektor. » 2014-10-18 13:59:04 Witam! Chcę zrobić na wzór z jednej lekcji konstruktor do dość sporej klasy, a pózniej zamknąć go w std::vector. Wszystko super, tylko jest mały problem- nie mam pojecia jak wrzucic w ten konstruktor tablice. class hero { sf::Vector2f vhead; sf::Vector2f vbody; sf::Vector2f vlegs; sf::Vector2f vshield; sf::Vector2f vweapon; int self_animation_time; bool bool_self_animation; int frame_number; int tab_id[ 4 ]; int tab_image_h[ 4 ]; int tab_image_w[ 4 ]; float speed; int stats[ 8 ]; long long exp; hero( sf::Vector2f Cvhead, sf::Vector2f Cvbody, sf::Vector2f Cvlegs, sf::Vector2f Cvshield, sf::Vector2f Cvweapon, int Cself_animation_time, bool Cbool_self_animation, int Cframe_number, int Ctab_id[ 4 ], int Ctab_image_h[ 4 ], int Ctab_image_w[ 4 ], float speed, int stats[ 8 ], long long exp ); void split_n_animate_hero(); void move_hero(); void hero_action(); };
hero::hero( sf::Vector2f Cvhead, sf::Vector2f Cvbody, sf::Vector2f Cvlegs, sf::Vector2f Cvshield, sf::Vector2f Cvweapon, int Cself_animation_time, bool Cbool_self_animation, int Cframe_number, int Ctab_id[ 4 ], int Ctab_image_h[ 4 ], int Ctab_image_w[ 4 ], float speed, int stats[ 8 ], long long exp )
: vhead( Cvhead ) , vbody( Cvbody ) , vlegs( Cvhead ) , vshield( Cvshield ) , vweapon( Cvweapon ) , self_animation_time( Cself_animation_time ) , bool_self_animation( Cbool_self_animation ) , frame_number( Cframe_number ) , tab_id[ 4 ]( Ctab_id ) , Ma ktoś pomysł jak to zrobić? |
|
Monika90 |
» 2014-10-18 14:18:24 W jaki sposób chciałbyś konstruktor klasy hero wywoływać? |
|
Jacahehe Temat założony przez niniejszego użytkownika |
» 2014-10-18 14:49:37 |
|
« 1 » |