-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCrowbar.h
43 lines (39 loc) · 1.01 KB
/
Crowbar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Author: Robert Weber
*
* Created on November 14, 2012, 2:21 PM
*/
#pragma once
#include <stdint.h>
#include <map>
#include <string>
#include <set>
#include <vector>
#include "Headcrab.h"
struct _zctx_t;
typedef struct _zctx_t zctx_t;
class Crowbar {
public:
explicit Crowbar(const std::string& binding);
explicit Crowbar(const Headcrab& target);
Crowbar(const std::string& binding, zctx_t* context);
virtual ~Crowbar();
bool Wield();
bool Swing(const std::string& hit);
bool Flurry( std::vector<std::string>& hits);
bool BlockForKill(std::vector<std::string>& guts);
bool WaitForKill(std::vector<std::string>& guts, const int timeout);
bool BlockForKill(std::string& gut);
bool WaitForKill(std::string& gut,const int timeout);
void* GetTip();
static int GetHighWater();
zctx_t* GetContext();
private:
bool PollForReady();
Crowbar(const Crowbar& that) : mContext(NULL), mTip(NULL) {
}
zctx_t* mContext;
std::string mBinding;
void* mTip;
bool mOwnsContext;
};