File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,7 @@ static unmove_mask_lo: [u32; 100] = init_move_masks()[3];
70
70
static mut database_head: Option < Box < DatabaseType > > = None ;
71
71
static mut players: PlayerDatabaseType =
72
72
PlayerDatabaseType { prolog :
73
- PrologType { creation_century : 0 ,
74
- creation_year : 0 ,
75
- creation_month : 0 ,
76
- creation_day : 0 ,
77
- game_count : 0 ,
78
- item_count : 0 ,
79
- origin_year : 0 ,
80
- reserved : 0 , } ,
73
+ PrologType :: new ( ) ,
81
74
name_buffer :
82
75
b"" ,
83
76
player_list : Vec :: new ( ) , } ;
@@ -95,14 +88,7 @@ static mut thor_search: SearchResultType =
95
88
} ;
96
89
static mut tournaments: TournamentDatabaseType =
97
90
TournamentDatabaseType { prolog :
98
- PrologType { creation_century : 0 ,
99
- creation_year : 0 ,
100
- creation_month : 0 ,
101
- creation_day : 0 ,
102
- game_count : 0 ,
103
- item_count : 0 ,
104
- origin_year : 0 ,
105
- reserved : 0 , } ,
91
+ PrologType :: new ( ) ,
106
92
name_buffer : b"" ,
107
93
tournament_list : Vec :: new ( ) } ;
108
94
static mut thor_opening_tree: ThorOpeningTree = ThorOpeningTree :: new ( ) ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ impl PlayerDatabaseType {
76
76
} ;
77
77
}
78
78
}
79
- #[ derive( Copy , Clone ) ]
79
+ #[ derive( Clone ) ]
80
80
#[ repr( C ) ]
81
81
pub struct PrologType {
82
82
pub creation_century : i32 ,
@@ -88,6 +88,22 @@ pub struct PrologType {
88
88
pub origin_year : i32 ,
89
89
pub reserved : i32 ,
90
90
}
91
+
92
+ impl PrologType {
93
+ pub const fn new ( ) -> PrologType {
94
+ PrologType {
95
+ creation_century : 0 ,
96
+ creation_year : 0 ,
97
+ creation_month : 0 ,
98
+ creation_day : 0 ,
99
+ game_count : 0 ,
100
+ item_count : 0 ,
101
+ origin_year : 0 ,
102
+ reserved : 0 ,
103
+ }
104
+ }
105
+ }
106
+
91
107
#[ derive( Clone ) ]
92
108
#[ repr( C ) ]
93
109
pub struct DatabaseType {
You can’t perform that action at this time.
0 commit comments