Select Git revision
-
TacoTheDank authored
- android studio 3.1.4 -> 3.2.0 yay - buildTools 28.0.2 -> 28.0.3 - finally a stable 28 library; 28.0.0 - removed acastus because, quote, "Acastus was moved to the archive because the service it relies on has shut down." (will preserve deleted xmls and svgs from now on in "removed") - fixed some english in README.md, found the [source](https://hike.in/images/hike5.0/apk.png) of the "download apk" image (literally a [singular source](https://www.google.com/search?q=circle&tbm=isch&tbs=simg:CAQSlwEJp6GzSFSZlf4aiwELEKjU2AQaBAgVCAoMCxCwjKcIGmIKYAgDEiibCoUDmhSBCvoGggqnE5sUoAqxFJk9lz2YPbE9lj2zPZg3mzSyPaA9GjCM6UrpBbzL0s24_1QhkZ45iiOiV8t-up23b_1EIQGMpUlKZAdxL4-D6Go9PzoIuNAv0gBAwLEI6u_1ggaCgoICAESBIdEHOEM&sa=X&ved=0ahUKEwijzuCfwObdAhVLVK0KHR-GBGgQ2A4IKygB&biw=1366&bih=577#imgrc=rnbxo0O8BRsYcM:); it doesn't exist anywhere else on the indexable internet https://hike.in/images/hike5.0/apk.png ) - removed a bunch of weird-ass spaces in the .sh files, don't think it will affect anything - deleted old "Get-it-on-F-Droid.svg.png" that for some reason i havent deleted yet, probably because i didnt notice it Signed-off-by:
TacoTheDank <SkytkRSfan3895@gmail.com>
TacoTheDank authored- android studio 3.1.4 -> 3.2.0 yay - buildTools 28.0.2 -> 28.0.3 - finally a stable 28 library; 28.0.0 - removed acastus because, quote, "Acastus was moved to the archive because the service it relies on has shut down." (will preserve deleted xmls and svgs from now on in "removed") - fixed some english in README.md, found the [source](https://hike.in/images/hike5.0/apk.png) of the "download apk" image (literally a [singular source](https://www.google.com/search?q=circle&tbm=isch&tbs=simg:CAQSlwEJp6GzSFSZlf4aiwELEKjU2AQaBAgVCAoMCxCwjKcIGmIKYAgDEiibCoUDmhSBCvoGggqnE5sUoAqxFJk9lz2YPbE9lj2zPZg3mzSyPaA9GjCM6UrpBbzL0s24_1QhkZ45iiOiV8t-up23b_1EIQGMpUlKZAdxL4-D6Go9PzoIuNAv0gBAwLEI6u_1ggaCgoICAESBIdEHOEM&sa=X&ved=0ahUKEwijzuCfwObdAhVLVK0KHR-GBGgQ2A4IKygB&biw=1366&bih=577#imgrc=rnbxo0O8BRsYcM:); it doesn't exist anywhere else on the indexable internet https://hike.in/images/hike5.0/apk.png ) - removed a bunch of weird-ass spaces in the .sh files, don't think it will affect anything - deleted old "Get-it-on-F-Droid.svg.png" that for some reason i havent deleted yet, probably because i didnt notice it Signed-off-by:
TacoTheDank <SkytkRSfan3895@gmail.com>
activity_cubit.dart 3.84 KiB
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:snake/models/activity/activity.dart';
import 'package:snake/models/settings/settings_activity.dart';
import 'package:snake/models/settings/settings_global.dart';
part 'activity_state.dart';
class ActivityCubit extends HydratedCubit<ActivityState> {
ActivityCubit()
: super(ActivityState(
currentActivity: Activity.createEmpty(),
));
void updateState(Activity activity) {
emit(ActivityState(
currentActivity: activity,
));
}
void refresh() {
final Activity activity = Activity(
// Settings
activitySettings: state.currentActivity.activitySettings,
globalSettings: state.currentActivity.globalSettings,
// State
isRunning: state.currentActivity.isRunning,
isStarted: state.currentActivity.isStarted,
isFinished: state.currentActivity.isFinished,
animationInProgress: state.currentActivity.animationInProgress,
// Base data
snake: state.currentActivity.snake,
board: state.currentActivity.board,
boardSize: state.currentActivity.boardSize,
// Game data
score: state.currentActivity.score,
gameWon: state.currentActivity.gameWon,
);
// game.dump();
updateState(activity);
}
void startNewActivity({
required ActivitySettings activitySettings,
required GlobalSettings globalSettings,
}) {
final Activity newActivity = Activity.createNew(
// Settings
activitySettings: activitySettings,
globalSettings: globalSettings,
);
newActivity.dump();
updateState(newActivity);
updateGameIsRunning(true);
startSnake();
refresh();
}
void quitActivity() {
state.currentActivity.isRunning = false;
refresh();
}