MCPcopy Create free account
hub / github.com/RustOtomeLab/RustEng / backlog

Method backlog

src/script.rs:171–190  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

169 let new_offset = (self.backlog_offset as i32 + offset).max(0);
170 // 不能超过最大可偏移量
171 let max_offset = self.max_offset();
172 self.backlog_offset = new_offset.min(max_offset as i32) as usize;
173 }
174
175 fn max_offset(&self) -> usize {
176 self.backlog.len().saturating_sub(WINDOW_SIZE)
177 }
178
179 pub(crate) fn set_current_bgm(&mut self, bgm: String) {
180 self.current_bgm = bgm;
181 }
182
183 pub(crate) fn set_pre_voice(&mut self, pre_voice: (SharedString, SharedString)) {
184 self.pre_voice = Some(pre_voice);
185 }
186
187 pub(crate) fn set_pre_items(&mut self, jump_index: Option<usize>) {
188 if let Some(index) = jump_index {
189 self.pre_items = self.timeline.pre_items(index, &self.current_bgm);
190 self.current_block = index;
191 }
192 }
193

Callers 1

execute_backlogMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected