private void SaveGameToFile() { // TODO Save game HandPieceEV[] handPieces = handService.FindAllHandPieces(entitiesDB); PieceEV[] pieces = pieceFindService.FindAllBoardPieces(entitiesDB); string fileName = "saved_game.txt"; if (isMobile) { fileName = Path.Combine(persistentDataPath, fileName); } using (var tw = new StreamWriter(fileName, false)) { tw.WriteLine(CreateTurnSaveInfoString()); for (int i = 0; i < handPieces.Length; ++i) { if (handPieces[i].HandPiece.NumPieces.value > 0) { tw.WriteLine(CreateHandPieceSaveInfoString(handPieces[i])); } } for (int i = 0; i < pieces.Length; ++i) { tw.WriteLine(CreatePieceSaveInfoString(pieces[i])); } } }
private void UnPressHandPieces() { HandPieceEV[] handPieceEVs = handService.FindAllHandPieces(entitiesDB); for (int i = 0; i < handPieceEVs.Length; ++i) { if (handPieceEVs[i].Highlight.IsPressed.value) { handPieceEVs[i].Highlight.IsPressed.value = false; // Will trigger a HandPiecePressEngine, but IsPressed check will stop it } } }