ADD: LobbySolo
continuous-integration/drone/push Build is failing Details

Persistance
Alban GUILHOT 2 years ago
parent 8e1b296011
commit 2833fccaa2

@ -8,6 +8,7 @@ import { Game } from "../core/game"
Importing the correct stylesheet
*/
import styles from './style/Game.style';
import LobbySolo from "../screens/LobbySolo"
export const GameComponent :
/*
@ -17,9 +18,10 @@ export const GameComponent :
FC<{game: Game, nav: any}> =
({game, nav}) =>
{
return (
<View>
<Pressable onPress={() => nav.navigate("CookieClicker")}>
<Pressable onPress={() => createNewMatchSolo(game, nav)}>
<Image
style={styles.image}
source={{uri: game.getImageSource()}}
@ -29,3 +31,9 @@ FC<{game: Game, nav: any}> =
</View>
)
}
function createNewMatchSolo(game : Game, nav: any) {
nav.navigate("LobbySolo")
}

@ -12,7 +12,8 @@ import SkinList from '../screens/SkinList'
import GameChoice from '../screens/GameChoice'
import SignIn from '../screens/SignIn'
import SignUp from '../screens/SignUp'
import CookieClicker from '../Games/CookieClicker/CookieClicker'
import LobbySolo from '../screens/LobbySolo'
const HomeStack = createStackNavigator();
@ -25,7 +26,7 @@ function HomeStackScreen() {
<HomeStack.Navigator screenOptions={{ headerShown: false}}>
<HomeStack.Screen name="Home" component={Home} options={{animationEnabled: false,}}/>
<HomeStack.Screen name="Settings" component={Settings} />
<HomeStack.Screen name="GameChoice" component={GameChoice} options={{animationEnabled: false,}}/>
<HomeStack.Screen name='GameChoiceTab' component={GameChoiceStackScreen} options={{animationEnabled: false,}}/>
</HomeStack.Navigator>
);
}
@ -70,6 +71,21 @@ function ProfileStackScreen() {
);
}
const GameChoiceStack = createStackNavigator();
/*
Stack of screens for the profile and the changement of informations
*/
function GameChoiceStackScreen() {
return (
<ProfileStack.Navigator screenOptions={{headerShown: false}}>
<HomeStack.Screen name='GameChoice' component={GameChoice} options={{animationEnabled: false,}}/>
<ProfileStack.Screen name="LobbySolo" component={LobbySolo} options={{animationEnabled: false,}}/>
</ProfileStack.Navigator>
);
}
const Tab = createBottomTabNavigator()
/*
Tab navigator to navigate between the stacks

@ -13,12 +13,13 @@ import { GameSolo } from '../core/gameSolo';
let tabConv:Conversation[]=[];
const msc = require('../../assets/Icons/FondGris.png');
const cookieClicker= new GameSolo(1, "Cookie Clicker", require('../../assets/Icons/UnSelected/Gamepad.png'), "/Games/CookieClicker/cookieClicker.tsx", 1, 1, new Map<number,number>);
//const UserActu=new User("14", "leBg", "MdpDeOuf", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv);
const cookieClicker= new GameSolo(1, "Cookie Clicker", "https://codefirst.iut.uca.fr/git/BOB_PARTEAM/BOB_PARTY/raw/branch/typescript/bob_party/assets/BobsSkins/BobYellowGreenBlueHeart.png", "/Games/CookieClicker/cookieClicker.tsx", 1, 1, new Map<number,number>);
function GameChoice(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<TopBar

@ -6,19 +6,16 @@ import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
import { Conversation } from '../core/conversation';
import { ButtonGameTypeChoice } from '../components/ButtonGameTypeChoice';
import { useSelector } from 'react-redux';
import { RootState } from '../redux/store';
//const test= new GameSolo("test", require('bob_party/assets/ImagesJeux/BatailleNavale.jpeg'), "test", );
let tabConv:Conversation[]=[];
function Home(props: { navigation: any; }) {
const { navigation } = props
const { navigation } = props
return (
<View style={stylesScreen.container}>
<TopBar
@ -28,11 +25,11 @@ function Home(props: { navigation: any; }) {
<View style={stylesScreen.bodyCenter}>
<ButtonGameTypeChoice
title='Jouer Seul'
onPress={() => navigation.navigate('GameChoice')}
onPress={() => navigation.navigate('GameChoiceTab')}
/>
<ButtonGameTypeChoice
title='Défier mes amis'
onPress={() => navigation.navigate('GameChoice')}
onPress={() => navigation.navigate('GameChoiceTab')}
/>
</View>
<BotBar

@ -0,0 +1,31 @@
import { StatusBar } from 'expo-status-bar'
import { View} from 'react-native'
import React from 'react';
import stylesScreen from './style/screens.style'
import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
import { Conversation } from '../core/conversation';
import { ButtonGameTypeChoice } from '../components/ButtonGameTypeChoice';
let tabConv:Conversation[]=[];
function LobbySolo(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={stylesScreen.container}>
<View style={stylesScreen.bodyCenter}>
<ButtonGameTypeChoice
title='Lancer la partie'
onPress={() => navigation.navigate('GameChoice')}
/>
</View>
</View>
);
}
export default LobbySolo
Loading…
Cancel
Save