ScummVM API documentation
Nancy::Action::ScopaPuzzle Class Reference
Inheritance diagram for Nancy::Action::ScopaPuzzle:
Nancy::Action::PuzzleRecord Nancy::Action::RenderActionRecord Nancy::Action::ActionRecord Nancy::RenderObject

Classes

struct  Card
 
struct  CardState
 
struct  Fader
 
struct  Move
 
struct  Play
 
struct  Player
 
struct  Wait
 

Public Member Functions

void init () override
 
void readData (Common::SeekableReadStream &stream) override
 
void execute () override
 
void handleInput (NancyInput &input) override
 
bool isViewportRelative () const override
 
- Public Member Functions inherited from Nancy::Action::PuzzleRecord
 PuzzleRecord (uint zOrder)
 
Common::String getRecordExtraInfo () const override
 
- Public Member Functions inherited from Nancy::Action::RenderActionRecord
 RenderActionRecord (uint zOrder)
 
 RenderActionRecord (RenderActionRecord &&)=default
 
void onPause (bool pause) override
 
- Public Member Functions inherited from Nancy::Action::ActionRecord
virtual CursorManager::CursorType getHoverCursor () const
 
virtual bool cursorSetFromScript () const
 
virtual bool canHaveHotspot () const
 
virtual bool survivesSceneChange (bool nextSceneIsNoArt) const
 
- Public Member Functions inherited from Nancy::RenderObject
 RenderObject (uint16 zOrder)
 
 RenderObject (uint16 zOrder, Graphics::ManagedSurface &surface, const Common::Rect &srcBounds, const Common::Rect &destBounds)
 
 RenderObject (RenderObject &&)=default
 
virtual void registerGraphics ()
 
virtual void updateGraphics ()
 
void moveTo (const Common::Point &position)
 
void moveTo (const Common::Rect &bounds)
 
void setVisible (bool visible)
 
void setTransparent (bool isTransparent)
 
bool isVisible () const
 
bool needsRedraw () const
 
void setNeedsRedraw (bool needsRedraw)
 
void setHasMoved (bool hasMoved)
 
bool isNativeResolution () const
 
void setNativeResolution (bool isNative)
 
void grabPalette (byte *colors, uint paletteStart=0, uint paletteSize=256)
 
void setPalette (const Common::Path &paletteName, uint paletteStart=0, uint paletteSize=256)
 
void setPalette (const byte *colors, uint paletteStart=0, uint paletteSize=256)
 
bool hasMoved () const
 
void updatePreviousScreenPosition ()
 
Common::Rect getScreenPosition () const
 
Common::Rect getScreenPositionRaw () const
 
Common::Rect getPreviousScreenPosition () const
 
Common::Rect convertToLocal (const Common::Rect &screen) const
 
Common::Rect convertToScreen (const Common::Rect &rect) const
 
Common::Rect getBounds () const
 
uint16 getZOrder () const
 
void setZOrder (uint16 z)
 

Protected Types

enum  { kHuman = 0, kOpponent = 1 }
 
enum  Pile {
  kHumanHand = 0, kHumanTaken = 1, kHumanTrick = 2, kOpponentHand = 3,
  kOpponentTaken = 4, kOpponentTrick = 5, kDeck = 6, kTable = 7,
  kLaidOut = 8, kPrimes = 9, kNumPiles = 10, kPrimeValues = 10,
  kNumSlotLists = 11
}
 
enum  CardMode { kFaceUp = 0, kFaceDown = 1, kHidden = 2, kHighlighted = 3 }
 
enum  Phase {
  kDeal, kDealing, kPlaying, kTally,
  kScorePlayers, kScorePrimes
}
 
enum  Highlight { kAllCards, kCoinCards, kSevenOfCoinsCard }
 
enum  PlayError { kPlayAllowed, kWrongSum, kHasToTake, kHasToTakeOneCard }
 
enum  PlayerSound {
  kSoundScopa, kSoundLastCardsLong, kSoundLastCards, kSoundMostCards,
  kSoundMostCoins, kSoundSevenOfCoins, kSoundBestPrimes, kSoundNoPoints,
  kSoundWin, kNumPlayerSounds
}
 

Protected Member Functions

Common::String getRecordTypeName () const override
 
uint getOtherPlayer (uint playerID) const
 
uint countCards (int pile) const
 
void setCardState (int cardID, CardMode mode, const Common::Rect &rect)
 
void setCardMode (int cardID, CardMode mode)
 
int doMove (const Move &move)
 
void queueMove (int srcPile, uint srcIndex, int32 delay, int dstPile, CardMode mode)
 
bool runMoves ()
 
bool updateWaits ()
 
void waitForTime (uint32 time, int player=-1, int32 points=0)
 
void waitForSound (const RandomSoundBlock &sound, int player=-1, int32 points=0)
 
void startDealSound ()
 
void stopDealSound ()
 
void runPhase ()
 
void dealCards ()
 
void startTurn ()
 
void switchPlayer ()
 
PlayError checkPlay (const Play &play) const
 
void findPlays (Common::Array< Play > &plays) const
 
void makePlay (const Play &play)
 
void afterPlay ()
 
void moveTricksToTaken ()
 
void takeLastCards ()
 
void showPilePictures (bool show)
 
void updateButtons ()
 
void tallyPlayer (Player &player, int takenPile)
 
void tallyRound ()
 
void layOutTakenCards (uint playerID)
 
void highlightLaidOutCards (Highlight highlight)
 
void movePrimes (uint playerID)
 
bool scorePlayerStep ()
 
bool scorePrimesStep ()
 
void finishRound ()
 
void findSelectedCards (int pile, Common::Array< uint > &indices) const
 
int getHoveredCard (int pile, const Common::Point &pos) const
 
void clickCard (int pile, uint index)
 
void tryPlay (bool sayWhyNotToDiscard)
 
void blendPixel (int x, int y, byte a, byte r, byte g, byte b)
 
void blitFaded (const Graphics::ManagedSurface &image, const Common::Rect &src, const Common::Point &dest, uint32 argb, float alpha)
 
void drawCardState (int cardID, CardState &state)
 
void drawText (const Common::String &text, const Common::Rect &rect, uint fontID, uint colorID, Graphics::TextAlign align)
 
void redraw ()
 
- Protected Member Functions inherited from Nancy::Action::PuzzleRecord
void loadImage ()
 
void initViewportSurface ()
 
void setDataCursor (uint16 cursorType, bool hotspotVariant=true) const
 
Common::Point getHeldPiecePos (const Common::Point &mousePos, const Common::Rect &src, const Common::Point &offset) const
 
SoundDescription playSoundBlock (const RandomSoundBlock &block)
 
bool isSoundBlockPlaying (const RandomSoundBlock &block) const
 
void readExitHotspot (Common::SeekableReadStream &stream)
 
bool isExitHotspotHovered (const NancyInput &input) const
 
void setExitCursor () const
 
bool hoverExitHotspot (const NancyInput &input) const
 
bool hasSolveSound () const
 
void playSolveSound ()
 
bool isSolveSoundPlaying () const
 
- Protected Member Functions inherited from Nancy::Action::ActionRecord
void finishExecution ()
 

Static Protected Member Functions

static void readPlayer (Common::SeekableReadStream &stream, Player &player)
 
static void readSlots (Common::SeekableReadStream &stream, Common::Array< Common::Rect > &slots)
 
static int getHandPile (uint playerID)
 
static int getTakenPile (uint playerID)
 
static int getTrickPile (uint playerID)
 
static bool hasFixedPlaces (int pile)
 

Protected Attributes

Common::String _saveName
 
int32 _pointsToWin = 0
 
int16 _roundOverFlag = -1
 
int16 _redealFlag = -1
 
int32 _primesFontID = 0
 
int32 _primesColorID = 0
 
Player _players [kNumPlayers]
 
Common::Rect _takeSrc
 
Common::Rect _takeDest
 
Common::Rect _discardSrc
 
Common::Rect _discardDest
 
int32 _thinkTime = 0
 
int32 _dealTime = 0
 
int32 _layOutTime = 0
 
RandomSoundBlock _dealSound
 
RandomSoundBlock _discardSound
 
RandomSoundBlock _takeSound
 
RandomSoundBlock _wrongSumSound
 
RandomSoundBlock _hasToTakeSound
 
RandomSoundBlock _hasToTakeOneCardSound
 
RandomSoundBlock _noLastScopaSound
 
RandomSoundBlock _primesSound
 
RandomSoundBlock _primesTieSound
 
RandomSoundBlock _scopasSound
 
Common::Array< Common::Rect > _slots [kNumSlotLists]
 
Common::Path _cardsImageName
 
int32 _fadeInTime = 0
 
int32 _fadeOutTime = 0
 
uint32 _highlightColor = 0
 
Common::Rect _cardBackSrc
 
Common::Array< Common::Rect > _cardSrcs
 
Graphics::ManagedSurface _cardsImage
 
Common::Array< Card > _cards
 
Common::Array< int > _piles [kNumPiles]
 
Common::Array< Move > _moves
 
Common::Array< Wait > _waits
 
Phase _phase = kDeal
 
bool _isBusy = true
 
uint _starter = kHuman
 
uint _currentPlayer = kHuman
 
int _lastTaker = -1
 
bool _needsRedeal = false
 
bool _hasCheckedScopa = false
 
bool _hasSaidLastCardsLong = false
 
bool _hasSaidNoLastScopa = false
 
bool _showsPrimes = false
 
bool _showsPrimeTotals = false
 
bool _showsTake = false
 
bool _showsDiscard = false
 
Fader _takeFader
 
Fader _discardFader
 
SoundDescription _playingDealSound
 
SoundDescription _errorSound
 
bool _hasChanged = true
 
bool _isFading = false
 
- Protected Attributes inherited from Nancy::Action::PuzzleRecord
Common::Path _imageName
 
Graphics::ManagedSurface _image
 
SceneChangeWithFlag _solveScene
 
SoundDescription _solveSound
 
uint16 _solveSoundDelay = 0
 
SceneChangeWithFlag _exitScene
 
Common::Rect _exitHotspot
 
uint16 _exitCursorType = 0
 
bool _exitCursorFromData = false
 
- Protected Attributes inherited from Nancy::RenderObject
bool _needsRedraw
 
bool _isVisible
 
bool _hasMoved
 
bool _isNativeResolution = false
 
uint16 _z
 
Common::Rect _previousScreenPosition
 
Common::Rect _screenPosition
 

Static Protected Attributes

static const uint kNumPlayers = 2
 
static const int32 kWaitForCard = -1
 

Additional Inherited Members

- Public Types inherited from Nancy::Action::ActionRecord
enum  ExecutionState { kBegin, kRun, kActionTrigger }
 
enum  ExecutionType { kOneShot = 1, kRepeating = 2 }
 
- Public Attributes inherited from Nancy::Action::ActionRecord
Common::String _description
 
Common::String _includeSource
 
byte _type
 
ExecutionType _execType
 
DependencyRecord _dependencies
 
bool _isActive
 
bool _isDone
 
bool _hasHotspot
 
Common::Rect _hotspot
 
ExecutionState _state
 
DependencyRecord * _cursorDependency
 
- Public Attributes inherited from Nancy::RenderObject
Graphics::ManagedSurface _drawSurface
 

The documentation for this class was generated from the following file: