1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef DRACECAR_H |
|
18 #define DRACECAR_H |
|
19 |
|
20 // INCLUDES |
|
21 #include <kernel/kernel.h> |
|
22 #include "symbianunittestmacros.h" |
|
23 |
|
24 // CONSTANTS |
|
25 const TInt KMaxTyreAngle( 45 ); |
|
26 |
|
27 // CLASS DECLARATION |
|
28 class DRaceCar : public DBase |
|
29 { |
|
30 public: // Constructors and Destructor |
|
31 |
|
32 DRaceCar( const TDesC8& aColor, TUint aFuelTankSize ); |
|
33 ~DRaceCar(); |
|
34 |
|
35 public: // New functions |
|
36 |
|
37 TUint FuelTankSize() const; |
|
38 |
|
39 TUint FuelLeft() const; |
|
40 |
|
41 TUint AddFuel( TUint aFuel ); |
|
42 |
|
43 TInt Steer( TInt aAngle ); |
|
44 |
|
45 TInt Direction() const; |
|
46 |
|
47 TInt Accelerate( TUint aForce ); |
|
48 |
|
49 TUint Speed() const; |
|
50 |
|
51 void Brake( TUint aForce ); |
|
52 |
|
53 const TDesC8& Color() const; |
|
54 |
|
55 void ChangeColorL( const TDesC8& aNewColor ); |
|
56 |
|
57 private: // Constructors |
|
58 |
|
59 void ConstructL( const TDesC8& aColor ); |
|
60 DRaceCar( TUint aFuelTankSize ); |
|
61 |
|
62 private: // Data |
|
63 |
|
64 TUint iFuelTankSize; |
|
65 HBuf* iColor; |
|
66 TUint iFuel; |
|
67 TInt iDirection; |
|
68 TUint iSpeed; |
|
69 |
|
70 private: // Test class |
|
71 |
|
72 SYMBIAN_UNIT_TEST_CLASS( UT_DRaceCar ) |
|
73 }; |
|
74 |
|
75 #endif // DRACECAR_H |
|