mopoidpanel.h

来自「mopoid game symbian os application devel」· C头文件 代码 · 共 77 行

H
77
字号
/*
========================================================================
 Name        : MopoidPanel.h
 Author      : 
 Copyright   :
 Description : Handles the panel ("avatar" of the player).
 License     : 
 
========================================================================
*/
#ifndef __MOPOIDPANEL_H__
#define __MOPOIDPANEL_H__

#include <e32std.h>
#include "MopoidSharedData.h"
#include "MopoidSettings.h"

/**
 * Stores position and movement information about the mopoid panel.
 */
class TPanel {
public:
	TPanel();

	/**
	 * Store a pointer to the settings object.
	 * This is requied - without the pointer assigned, you will get
	 * null pointer exceptions (KERN-EXEC 3) as there are no checks
	 * for performance reasons.
	 * This class does not take ownership of this object.
	 */
	void SetSettingsPointer(CMopoidSettings* aSettings);
    
    /**
     * Set the speed of the panel according to the specified direction.
     */
    void KeyboardMove(MopoidShared::TDirection aDirection);
    
    /**
     * Set the speed of the panel directly.
     */
    void SetSpeed(TReal aSpeed);
    
    /**
     * Calculate the new position of the panel, using its current speed and
     * the time that has passed since the last frame.
     * @param aStep time difference to the last frame
     */
    void ConvertToPos(TReal aStep);

public:
    /**
     * Current screen position of the panel.
     */
	TPoint iPos;
        
    /**
     * Current exact position of the panel (x-axis).
     */
    TReal iX;
    
    /**
     * Current exact position of the panel (y-axis).
     */
    TReal iVx;

private:
	/**
	 * Pointer to the settings object, required for
	 * various calculations.
	 * Will need the size of some objects from the settings object.
	 */
	CMopoidSettings* iSettings;
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?