summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2PeopleAnimeDefElem.cpp
blob: 2e6c34d5d7baf3564b348585c948e87c22fd4b1b (plain)
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
#include "StdAfx.h"
#include "CResFile.h"
#include "T2People.h"
#include "T2PeopleAnimeDefElem.h"
#include "UT2Utils.h"

T2PeopleAnimeDefElem::T2PeopleAnimeDefElem() {
    mFillerStart = 0;
    mFillerRange = 0;
    mHStart = 0;
    mHRange = 0;
}

/*virtual*/ T2PeopleAnimeDefElem::~T2PeopleAnimeDefElem() {
}

void T2PeopleAnimeDefElem::Initialize(CResFile& resFile) {
    resFile >> mFillerStart;
    resFile >> mFillerRange;
    resFile >> mHStart;
    resFile >> mHRange;
}

void T2PeopleAnimeDefElem::Set(T2People* people, int h) {
    if (mFillerStart >= 0) {
        people->SetFiller(mFillerStart + UT2Utils::Randomize(mFillerRange));
        people->MoveHTo(h + mHStart + UT2Utils::Randomize(mHRange));
    } else {
        people->SetFiller(-1);
    }
}