sort cryps
This commit is contained in:
parent
f359332cf4
commit
1e4f2ccc80
@ -134,7 +134,7 @@ const CustomPipeline = new Phaser.Class({
|
|||||||
Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline.call(this, {
|
Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline.call(this, {
|
||||||
game,
|
game,
|
||||||
renderer: game.renderer,
|
renderer: game.renderer,
|
||||||
fragShader: PLASMA,
|
fragShader: STARS,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -189,8 +189,9 @@ pub fn account_cryps(tx: &mut Transaction, account: &Account) -> Result<Vec<Cryp
|
|||||||
return Err(err_msg("could not deserialize a cryp"));
|
return Err(err_msg("could not deserialize a cryp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// now unwrap is safe
|
let mut cryps = cryps.unwrap();
|
||||||
return Ok(cryps.unwrap());
|
cryps.sort_by_key(|c| c.id);
|
||||||
|
return Ok(cryps);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn account_game_history(tx: &mut Transaction, account: &Account) -> Result<Vec<Game>, Error> {
|
pub fn account_game_history(tx: &mut Transaction, account: &Account) -> Result<Vec<Game>, Error> {
|
||||||
|
|||||||
@ -160,6 +160,7 @@ impl Game {
|
|||||||
let index = team.cryps.iter().position(|t| t.id == cryp.id).unwrap();
|
let index = team.cryps.iter().position(|t| t.id == cryp.id).unwrap();
|
||||||
team.cryps.remove(index);
|
team.cryps.remove(index);
|
||||||
team.cryps.push(cryp.clone());
|
team.cryps.push(cryp.clone());
|
||||||
|
team.cryps.sort_unstable_by_key(|c| c.id);
|
||||||
},
|
},
|
||||||
None => panic!("cryp not in game"),
|
None => panic!("cryp not in game"),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user