Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Spinning Card  (Read 18051 times)

0 Members and 1 Guest are viewing this topic.

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: Spinning Card
« Reply #15 on: April 18, 2015, 12:11:39 am »
Hi,

I would like to use your class in an open-source game. I am kind of inexperienced with licensing and I don't know what I have to do so I am allowed to use your code.

BTW, I would like to add you to my credits section, however, I am unsure about how to actually credit you.

Raincode

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
AW: Spinning Card
« Reply #16 on: April 18, 2015, 12:38:21 am »
It uses the same license as SFML does. As long as you don't claim you wrote that piece of code, mark modifications as sucg and keep the license with the source, you're covered.
Crediting is not necessary but usually welcome and can be done in anyway you want, e.g. stating his name and maybe add a link. But of course if Hapax has a special wish he might say it himself. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: Spinning Card
« Reply #17 on: April 18, 2015, 10:38:01 am »
Hi,

thanks for answering.

Does that mean I simply copy the license.txt from github into the game folder when I redistribute it?

Does this mean, that my game must run under the same license?

Raincode

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: Spinning Card
« Reply #18 on: April 18, 2015, 11:11:17 am »
As far as I understand it, you only have to provide the license file when distributing the source code, so you won't even have to provide it, when you ship the binaries.
And no, you can pick nearly any license you want for your own source code.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: Spinning Card
« Reply #19 on: April 18, 2015, 02:22:47 pm »
I think I understood it now.

I have one more question regarding the SpinningCard: In my game, I have a vector of Cards (a own class that kind of combines 2 spinning cards to get an actual card (front+back)). I want to use std::random_shuffle on it, but I get this error with VC++:

std::random_shuffle(field.begin(), field.end());
error C2582: 'operator =' function is unavailable in 'hx::Misc::SpinningCard'

As I understand it, the default Copy-Assignment-Operator is not there (and the compiler can't provide one).
I am really unsure about how this function

SpinningCard& SpinningCard::operator=(const SpinningCard&);

would have to look like. Also, do I need a copy-constructor, too?

I would be very happy if someone could help me out with that, or maybe give me some alternatives where I don't need to define these.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Spinning Card
« Reply #20 on: April 18, 2015, 02:41:25 pm »
Yes, your elements must support copy semantics (C++98) or at least move semantics (C++11) in order to be shuffled. That is, copy/move constructor and copy/move assignment operator must be accessible.

You're hijacking a project thread with basic C++ questions that are not even related to SFML... That's not nice. You should really have a look at a good C++ book, and ask programming-related questions on a different platform (e.g. StackOverflow).

Please don't pollute this thread further with off-topic discussions, let's focus on Spinning Card :)
« Last Edit: April 18, 2015, 02:44:25 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Spinning Card
« Reply #21 on: April 19, 2015, 10:05:43 pm »
Hi, Raincode. I'm glad that you are interested in using this class. It's nice that it's useful :)

Licensing-wise, it just requires that you include the licence with the source code and that you don't claim to have created it (this class).
It doesn't require credit outside of the source code but, of course, any is extremely appreciated. That said, suggested possible ways to credit - if you do still choose to do so - would be a link to my github, a link to my profile on the SFML forum, my email (included in the licence), or just Hapax or Hapaxia  ;)

Spinning Card wasn't designed to be used as an actual object itself (that is copied, moved, compared, sorted etc.) but rather an animation object that temporarily replaces a standard sprite (the card) during the spin animation and then re-replaced by the sprite (the card - most likely, the other side). This way, if you only spin one card at a time, you only require one instance of SpinningCard, and it only needs to exist for the duration of the spin animation.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
AW: Spinning Card
« Reply #22 on: April 20, 2015, 04:00:12 pm »
Btw it should be called license.txt and not licence.txt. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: Spinning Card
« Reply #23 on: April 23, 2015, 12:03:13 am »
thanks for mentioning possible ways to credit. Additionally, thanks for the hint about the "correct" use of the class.

Maybe I can change my Code so it works the way you described, that way seems like it makes more sense.

Sorry for posting questions beforehand that were off-topic, it was wrong to do so.

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: AW: Spinning Card
« Reply #24 on: April 26, 2015, 09:32:56 pm »
@Raincode
Don't worry too much about your questions. If I was clear about how the class worked, you wouldn't've needed to ask them (for this particular case) here.
I do have one request that I forgot to mention. If you do use this class, it would be great if you could 1) mention or link your project in this thread so that I can see how people found a use for it, and 2) "star" the repository on github. Thanks  :)

it should be called license.txt and not licence.txt. ;)
I beg to differ  :P
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: AW: Spinning Card
« Reply #25 on: April 27, 2015, 09:38:53 am »
it should be called license.txt and not licence.txt. ;)
I beg to differ  :P
Ah well, it's again an British vs American English issue. ;D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Spinning Card
« Reply #26 on: April 27, 2015, 01:43:51 pm »
Quote
Ah well, it's again an British vs American English issue. ;D
The EU calls our driver permits "licence" in English texts (and Switzerland, despite not being a member, adopted some of the legislation of EU about driving licences and Swiss one has the word "licence" written on it too.. :D) so I'd say it's the correct one for us Europeans... :P
« Last Edit: April 27, 2015, 01:50:37 pm by FRex »
Back to C++ gamedev with SFML in May 2023

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Spinning Card
« Reply #27 on: April 28, 2015, 02:12:04 am »
I succumb to using American English in code for consistencies (e.g. color) but find no real reason to use it for comments, documentation, filenames, etc..
Of course, one is allowed to use which ever version one prefers/feels more comfortable with so I won't complain if anyone uses something I don't  :D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*