~ruther/NosSmooth

ref: 321d3bff73eaf8f733ee55b02be96cbe395c22ea NosSmooth/Local/NosSmooth.LocalCore/Character.cpp -rw-r--r-- 817 bytes
321d3bff — František Boháček feat: accept types and variable names in inline converter generators instead of packet parameters 3 years ago
                                                                                
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
#include "Character.h"
#include <windows.h>
using namespace NosSmoothCore;
using namespace System;
using namespace System::Runtime::InteropServices;

Character::Character(ModuleHook moduleHook)
{
    CharacterUnmanaged::GetInstance()->Setup(moduleHook);
}

void Character::Walk(int x, int y)
{
    DWORD position = (y << 16) | x;
    CharacterUnmanaged::GetInstance()->Walk(position);
}

void Character::SetWalkCallback(WalkCallback^ walkCallback)
{
    _walkCallback = walkCallback;
    IntPtr functionPointer = Marshal::GetFunctionPointerForDelegate(walkCallback);
    CharacterUnmanaged::GetInstance()->SetWalkCallback(static_cast<NativeWalkCallback>(functionPointer.ToPointer()));
}

void NosSmoothCore::Character::ResetHooks()
{
    CharacterUnmanaged::GetInstance()->ResetHooks();
}
Do not follow this link