-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (39 loc) · 1.96 KB
/
main.cpp
File metadata and controls
47 lines (39 loc) · 1.96 KB
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
44
45
46
47
#include <iostream>
#include <ctime>
#include <cstdlib>
/// 包含 includes 和所有必要的定义。
#include "Achievement.h"
/// 包含 ServerUser 类定义。
#include "ServerUser.h"
/// 说明 ServerUser 提供 userOnline/userOffline 转发接口。
/// 说明 SelfSystem 实现了 IUserOnline 接口。
/// 说明 Inventory 实现了 ISaveLoad 接口。
/// =================================================================
/// 4. main.cpp - 扩展功能测试
/// =================================================================
int main() {
/// 初始化随机数种子。
srand(static_cast<unsigned int>(time(nullptr)));
ServerUser user;
std::cout << "==============================================================\n";
std::cout << " TEST STARTUP & INIT\n";
std::cout << "==============================================================\n";
user.userOnline();
user.logAllProps();
std::cout << "==============================================================\n";
std::cout << " TEST CORE MECHANICS\n";
std::cout << "==============================================================\n";
auto& selfsystem = user.getSelfSystem();
selfsystem.killPeople(10);
user.logAllProps();
std::cout << "[" << typeid(Achievement).name() << "] featenum = " << user.getAchievement().featType << " ...";
std::cout << "--------------------------------------------------------------\n";
std::cout << "==============================================================\n";
std::cout << " OFFLINE\n";
std::cout << "==============================================================\n";
user.userOffline();
std::cout << "==============================================================\n";
std::cout << " TEST END\n";
std::cout << "==============================================================\n";
return 0;
}