NS/releases/3.01/source/mod/AvHSelectionHelper.h
Karl 04c334c94b Tagging 3.01 release (again)
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@15 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-03-12 22:19:53 +00:00

44 lines
No EOL
2 KiB
C++

#ifndef AVH_SELECTION_HELPER_H
#define AVH_SELECTION_HELPER_H
#include "mod/AvHConstants.h"
// Selection stuff shared between client and server
// Queues up selection requests, executes them after prediction, once all values are set up
// Used by AvHHud and AvHPlayer to make sure selection is predicted as accurately as possible
class AvHSelectionHelper
{
public:
AvHSelectionHelper();
//void CategorizeSelection(const Vector& inPointOfView, const Vector& inStartRay, SelectionInfo& outInfo);
void ClearSelection();
void GetAndClearSelection(EntityListType& outSelectedList);
void ProcessPendingSelections();
void QueueSelection(const Vector& inPointOfView, const Vector& inStartRay, const Vector& inEndRay, AvHTeamNumber inTeamNumber);
bool SelectionResultsWaiting();
private:
bool IsPositionInRegion(const Vector& inPosition, const Vector& inPointOfView, const Vector& inNormRayOne, const Vector& inNormRayTwo);
void ProcessEntityForSelection(const Vector& inOrigin, const Vector& inPointOfView, const Vector& inNormRayOne, const Vector& inNormRayTwo, int inIndex, bool inIsPlayer, bool inIsMarkedSelectable, bool inSameTeam, bool inIsVisible);
//void SelectLocation(const Vector& inPointOfView, const Vector& inNormRay, Vector& outVector);
bool SelectUnitsInRegion(const Vector& inPointOfView, const Vector& inNormRayOne, const Vector& inNormRayTwo, AvHTeamNumber inTeamNumber, EntityListType& outEntIndexList);
bool SelectUnits(const Vector& inPointOfView, const Vector& inStartRay, const Vector& inEndRay, AvHTeamNumber inTeamNumber, EntityListType& outEntIndexList);
Vector mQueuedPointOfView;
Vector mQueuedRayOne;
Vector mQueuedRayTwo;
bool mQueuedSelectionWaiting;
AvHTeamNumber mQueuedTeamNumber;
EntityListType mSelectionResults;
bool mSelectionResultsWaiting;
EntityListType mFriendlyPlayers;
EntityListType mFriendlyBuildings;
EntityListType mNonFriendlyPlayers;
EntityListType mNonFriendlyBuildings;
//EntityList mWorldObjects;
};
#endif