ScummVM API documentation
time_object.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef BAGEL_BAGLIB_TIME_OBJECT_H
24 #define BAGEL_BAGLIB_TIME_OBJECT_H
25 
26 #include "bagel/baglib/object.h"
27 #include "bagel/boflib/gfx/bitmap.h"
28 #include "bagel/boflib/gfx/sprite.h"
29 
30 namespace Bagel {
31 
35 class CBagTimeObject : public CBagObject {
36 private:
37  CBofString _sVariable;
38 
39  CBofSprite *_xDig1; // x-:--
40  CBofSprite *_xDig2; // -x:--
41  CBofSprite *_xColon; // --:--
42  CBofSprite *_xDig3; // --:x-
43  CBofSprite *_xDig4; // --:-x
44 
45  int _nCels;
46 
47 public:
49  virtual ~CBagTimeObject();
50 
54  ErrorCode attach() override;
55  ErrorCode detach() override;
56  bool isAttached() override {
57  return _xDig1 != nullptr;
58  }
59 
64  ParseCodes setInfo(CBagIfstream &istr) override;
65 
66  CBofRect getRect() override;
67  int getCels() {
68  return _nCels;
69  }
70 
71  void setCels(int nCels);
72  void setPosition(const CBofPoint &pos) override;
73 
79  ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect = nullptr, int /*nMaskColor*/ = -1) override;
80 
81  void setVariable(const CBofString &sProp) {
82  _sVariable = sProp;
83  }
84 };
85 
86 } // namespace Bagel
87 
88 #endif
ErrorCode attach() override
Definition: bitmap.h:55
ParseCodes setInfo(CBagIfstream &istr) override
Definition: sprite.h:38
Definition: rect.h:36
Definition: object.h:85
Definition: ifstream.h:31
Definition: string.h:38
Definition: bagel.h:31
Definition: point.h:34
ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect=nullptr, int=-1) override
Definition: time_object.h:35