-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathship.h
39 lines (37 loc) · 849 Bytes
/
ship.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
//
// Created by xinya on 2024/3/8.
//
#ifndef HARBOR_MANAGER__SHIP_H_
#define HARBOR_MANAGER__SHIP_H_
#include <iostream>
#include "map_object.h"
#include "berth.h"
struct Ship : MapObject {
static int capacity;
enum ShipStatus {
kLoad,
kRecover,
kNormal,
kToTerminal,
kToBerth,
};
int aim{};
int dir{};
int nowGoods{};
int nowBerth{};
Ship() = default;
Ship(int id, int x, int y) : MapObject{id, kNormal, Position{x, y}} {}
void PrintShip() const {
std::cout << "ship " << this->id << std::endl;
}
void PrintDept() const {
std::cout << "dept " << this->id << std::endl;
}
void PrintBerth() const {
std::cout << "berth " << this->id << std::endl;
}
void PrintRot(int d) const {
std::cout << "rot " << this->id << " " << d << std::endl;
}
};
#endif //HARBOR_MANAGER__SHIP_H_