CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 26

Threaded View

  1. #1
    Join Date
    Oct 2009
    Posts
    19

    Talking My new GoFish thread.

    Well... long story short I had another thread about a month ago ? maybe a little later.. I went through the design process like.. 10 times and now I think I finally have my final design pretty pat..

    I'm only having one simple issue.. I have a class Card that holds and int Face(1 ace, 2 two, 13 king) and int Suit (1 heart, 4 spade). Player hands are a list of card objects, same goes for the deck..

    Code:
    list <Card> Contents..
    list <Card> Hand
    I want to pushback a copy of a card from the deck, and put it into my hand..
    Code:
    list <Card>::iterator i = Deck.Contents.begin();
    **** iterate through list *****
    this->Hand.pushback(*i);
    It seems to work for one iteration but .. only one...
    Does anyone have any ideas? I've looked everywhere...
    I tried allocating a new card new Card (suit, face) and trying to copy it over insert..
    but I'm a little lost...

    edited to add source.
    Attached Files Attached Files
    Last edited by exiledgolem; November 24th, 2009 at 12:28 PM. Reason: added source...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured