resonance 1.0.1
Loading...
Searching...
No Matches
powerup.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5#include "os/mem.h"
6
7class Player;
8
27class Powerup {
28public:
37 void *operator new(size_t nSize) {
38 return AllocateTaggedMemory(nSize, "Powerup");
39 }
40
48 void operator delete(void *pBlock) {
49 OperatorDeleteOverride(pBlock, "Powerup");
50 }
51
56 virtual ~Powerup();
57
76 virtual int Deploy(int nTrack, int nBar, Player *pPlayer, int nUnused) = 0;
77
87 virtual int Type() = 0;
88
102 static Powerup *CreateForType(int nType);
103};
One participant in a session, local or remote.
Definition player.h:39
Base of the thirteen powerups a player can store and deploy.
Definition powerup.h:27
virtual ~Powerup()
static Powerup * CreateForType(int nType)
Produce one powerup of the requested kind on the heap.
virtual int Type()=0
Report which of the thirteen kinds this powerup is.
virtual int Deploy(int nTrack, int nBar, Player *pPlayer, int nUnused)=0
Apply the powerup's effect.
void OperatorDeleteOverride(void *pBlock, const char *pszClass)
Release a block that AllocateTaggedMemory() handed out.
void * AllocateTaggedMemory(size_t nSize, const char *pszClass)
Allocate a block for one object of a named class.