96 memcpy(m_number, other.m_number,
sizeof(m_number));
106 for (
int i = KIND_MAX - 1; i >= 0; i-- )
112 ASSERT( amount == 0 );
122 for (
int i = 0; i < KIND_MAX; i++ )
124 m_number[i] += other.m_number[i];
136 for (
int i = 0; i < KIND_MAX; i++ )
152 for (
int i = 0; i < KIND_MAX; i++ )
154 r &= (m_number[i] >= other.m_number[i]);
168 return (a >= amount);
181 for (
int i = 0; i < KIND_MAX; i++ )
183 ASSERT( m_number[i] >= other.m_number[i] );
184 m_number[i] -= other.m_number[i];
208 _pay.m_number[i] = r;
216 for (
int i = 0; i < KIND_MAX; i++ )
236 for (
int i = 0; i < KIND_MAX; i++ )
238 if ( m_number[i] > 0 )
241 OutputDebugString(work);
244 wsprintf(work, _T(
"計%d円\n"),
GetAmount());
245 OutputDebugString(work);
256 static const DWORD aKind[KIND_MAX] =
279 DWORD m_number[KIND_MAX];
#define loop_dn(VAR, CNT)
loop構文.
CMoney & operator+=(const CMoney &other)
[代入] 加算代入.
DWORD Get(EKind k) const
[取得] 個々金種枚数取得
void Dump(void) const
[表示] デバグ用表示.
bool CanMakePayment(DWORD amount) const
[確認] 支払い可能?
static DWORD GetKindAmound(int kind)
金種金額取得.
int CheckMakePaymentKind(CMoney &_pay, DWORD amount)
[確認] 支払い金種確認.
void Set(EKind k, DWORD c)
[設定 個々金種枚数設定
void Initialize(void)
[設定] 初期化.
void Set(const CMoney &other)
[設定] 代入
DWORD GetAmount(void) const
[取得] 金額取得
bool CanMakePayment(const CMoney &other) const
[確認] 支払い可能?
bool MakePayment(const CMoney &other)
[確認] 支払い
void SetAmount(DWORD amount)
[設定] 金額設定.
void Zero(V &value)
[設定] ゼロクリア.