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 CRACECAR_H |
|
18 #define CRACECAR_H |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32base.h> |
|
22 #include <symbianunittestmacros.h> |
|
23 |
|
24 // CONSTANTS |
|
25 const TInt KMaxTyreAngle( 45 ); |
|
26 |
|
27 // CLASS DECLARATION |
|
28 class CRaceCar : public CBase |
|
29 { |
|
30 public: // Constructors and Destructor |
|
31 |
|
32 static CRaceCar* NewL( const TDesC& aColor, TUint aFuelTankSize ); |
|
33 static CRaceCar* NewLC( const TDesC& aColor, TUint aFuelTankSize ); |
|
34 ~CRaceCar(); |
|
35 |
|
36 public: // New functions |
|
37 |
|
38 TUint FuelTankSize() const; |
|
39 |
|
40 TUint FuelLeft() const; |
|
41 |
|
42 TUint AddFuel( TUint aFuel ); |
|
43 |
|
44 TInt Steer( TInt aAngle ); |
|
45 |
|
46 TInt Direction() const; |
|
47 |
|
48 TInt Accelerate( TUint aForce ); |
|
49 |
|
50 TUint Speed() const; |
|
51 |
|
52 void Brake( TUint aForce ); |
|
53 |
|
54 const TDesC& Color() const; |
|
55 |
|
56 void ChangeColorL( const TDesC& aNewColor ); |
|
57 |
|
58 private: // Constructors |
|
59 |
|
60 void ConstructL( const TDesC& aColor ); |
|
61 CRaceCar( TUint aFuelTankSize ); |
|
62 |
|
63 private: // Data |
|
64 |
|
65 TUint iFuelTankSize; |
|
66 HBufC* iColor; |
|
67 TUint iFuel; |
|
68 TInt iDirection; |
|
69 TUint iSpeed; |
|
70 |
|
71 private: // Test class |
|
72 |
|
73 SYMBIAN_UNIT_TEST_CLASS( UT_CRaceCar ) |
|
74 }; |
|
75 |
|
76 #endif // CRACECAR_H |
|