1
// This file is part of hnefatafl-copenhagen.
2
//
3
// hnefatafl-copenhagen is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU Affero General Public License as published by
5
// the Free Software Foundation, either version 3 of the License, or
6
// (at your option) any later version.
7
//
8
// hnefatafl-copenhagen is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
// GNU Affero General Public License for more details.
12
//
13
// You should have received a copy of the GNU Affero General Public License
14
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
15
//
16
// SPDX-License-Identifier: AGPL-3.0-or-later
17
// SPDX-FileCopyrightText: 2025 David Campbell <david@hnefatafl.org>
18

            
19
#[derive(Clone, Debug)]
20
pub struct Characters {
21
    pub attacker: String,
22
    pub arrow_down: String,
23
    pub arrow_left: String,
24
    pub arrow_right: String,
25
    pub arrow_up: String,
26
    pub captured: String,
27
    pub dagger: String,
28
    pub defender: String,
29
    pub double_arrow_left: String,
30
    pub double_arrow_left_full: String,
31
    pub double_arrow_right: String,
32
    pub double_arrow_right_full: String,
33
    pub king: String,
34
    pub people: String,
35
    pub restricted_square: String,
36
    pub shield: String,
37
    pub warning: String,
38
}
39

            
40
impl Default for Characters {
41
24705
    fn default() -> Self {
42
24705
        Self {
43
24705
            attacker: "♟".to_string(),
44
24705
            arrow_down: "↓".to_string(),
45
24705
            arrow_left: "←".to_string(),
46
24705
            arrow_right: "→".to_string(),
47
24705
            arrow_up: "↑".to_string(),
48
24705
            captured: "🗙".to_string(),
49
24705
            dagger: "🗡".to_string(),
50
24705
            defender: "♙".to_string(),
51
24705
            double_arrow_left: "⏪".to_string(),
52
24705
            double_arrow_left_full: "⏮".to_string(),
53
24705
            double_arrow_right: "⏩".to_string(),
54
24705
            double_arrow_right_full: "⏭".to_string(),
55
24705
            king: "♔".to_string(),
56
24705
            people: "👥".to_string(),
57
24705
            restricted_square: "⌘".to_string(),
58
24705
            shield: "⛨".to_string(),
59
24705
            warning: "⚠".to_string(),
60
24705
        }
61
24705
    }
62
}
63

            
64
impl Characters {
65
    pub fn ascii(&mut self) {
66
        self.attacker = "A".to_string();
67
        self.arrow_down = "v".to_string();
68
        self.arrow_left = "<".to_string();
69
        self.arrow_right = ">".to_string();
70
        self.arrow_up = "^".to_string();
71
        self.captured = "X".to_string();
72
        self.dagger = "A".to_string();
73
        self.defender = "D".to_string();
74
        self.double_arrow_left = "<".to_string();
75
        self.double_arrow_left_full = "<<".to_string();
76
        self.double_arrow_right = ">".to_string();
77
        self.double_arrow_right_full = ">>".to_string();
78
        self.king = "K".to_string();
79
        self.people = "OO".to_string();
80
        self.restricted_square = "#".to_string();
81
        self.shield = "D".to_string();
82
        self.warning = "X".to_string();
83
    }
84
}