After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 1013 B After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 6.1 KiB |
@ -0,0 +1,16 @@
|
|||||||
|
import { FC} from "react"
|
||||||
|
import { Pressable, Text} from "react-native"
|
||||||
|
import React from "react"
|
||||||
|
import styles from "./style/ButtonChangeSkin.style"
|
||||||
|
|
||||||
|
export const ButtonChangeSkin:
|
||||||
|
FC<{ onPress: any;}>
|
||||||
|
=
|
||||||
|
({onPress}) =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<Pressable style={styles.button} onPress={onPress}>
|
||||||
|
<Text style={styles.text}>Changer de skin</Text>
|
||||||
|
</Pressable>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
import { FC} from "react"
|
||||||
|
import { Pressable, Text} from "react-native"
|
||||||
|
import React from "react"
|
||||||
|
/*
|
||||||
|
Importing the corresponding stylesheet
|
||||||
|
*/
|
||||||
|
import styles from "./style/ButtonGameTypeChoice.style"
|
||||||
|
|
||||||
|
export const ButtonGameTypeChoice:
|
||||||
|
/* Parameters:
|
||||||
|
* onPress : function that must be called when the button has been clicked
|
||||||
|
* title : optional text that would be in the button
|
||||||
|
*/
|
||||||
|
FC<{ onPress: any; title?: any | undefined; }>
|
||||||
|
=
|
||||||
|
({onPress,title}) =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<Pressable style={styles.button} onPress={onPress}>
|
||||||
|
<Text style={styles.text}>{title}</Text>
|
||||||
|
</Pressable>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
import { FC, ReactNode } from "react"
|
||||||
|
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
|
||||||
|
import React from "react"
|
||||||
|
import { Skin } from "../core/skin"
|
||||||
|
import { Conversation } from "../core/conversation"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Importing the correct stylesheet
|
||||||
|
*/
|
||||||
|
import styles from "./style/ConverstationComponent.style"
|
||||||
|
import { SkinComponent } from "./Skin"
|
||||||
|
|
||||||
|
export const ConversationComponent :
|
||||||
|
/* Parameters :
|
||||||
|
* skin : Skin to be displayed
|
||||||
|
* state : Indicates from wich screen the component has been called
|
||||||
|
*/
|
||||||
|
FC<{conv: Conversation, state: String}> =
|
||||||
|
({conv, state}) =>
|
||||||
|
{
|
||||||
|
/* The display of this component depends of the screen from where it has been called:
|
||||||
|
* From the TopBar (icon) : Small image in a circle
|
||||||
|
* From the shop (shop) : Image + Name + Price, Pressable => Buy the skin
|
||||||
|
* From the profile (profile) : Name + Image, Pressable => Change the skin
|
||||||
|
*/
|
||||||
|
switch (state) {
|
||||||
|
case 'Preview':
|
||||||
|
return(
|
||||||
|
<View style={{flexDirection: 'row', height: 70, borderBottomWidth: 2,borderBottomColor: '#2D2C33', paddingLeft: '5%',}}>
|
||||||
|
<View style={{alignSelf: 'center'}}>
|
||||||
|
<SkinComponent skin={conv.getTabUser()[1].getCurrentSkin()} state='icon'/>
|
||||||
|
</View>
|
||||||
|
<View style={{marginLeft: '5%', justifyContent: 'space-evenly'}}>
|
||||||
|
<Text style={styles.textNom}>{conv.getTabUser()[1].getUsername()}</Text>
|
||||||
|
<Text style={styles.textMess}>{conv.getLastMessage()}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
import { FC, ReactNode } from "react"
|
||||||
|
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
|
||||||
|
import React from "react"
|
||||||
|
import { trace } from "console"
|
||||||
|
import { Game } from "../core/Game"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Importing the correct stylesheet
|
||||||
|
*/
|
||||||
|
import styles from './style/Game.style';
|
||||||
|
|
||||||
|
export const GameComponent :
|
||||||
|
/*
|
||||||
|
* game : Game that must be displayed
|
||||||
|
* nav : tool needed to allow the navigation between the screens
|
||||||
|
*/
|
||||||
|
FC<{game: Game, nav: any}> =
|
||||||
|
({game, nav}) =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<Pressable onPress={() => Alert.alert("Lancement du jeu")}>
|
||||||
|
<Image
|
||||||
|
style={styles.image}
|
||||||
|
source={game.getImageSource()}
|
||||||
|
/>
|
||||||
|
<Text style={styles.name}>{game.getName()}</Text>
|
||||||
|
</Pressable>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
import { FC, ReactNode } from "react"
|
||||||
|
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
|
||||||
|
import React from "react"
|
||||||
|
import styles from './style/ScreenIndicator.style'
|
||||||
|
|
||||||
|
export const ScreenIndicator: FC<{title: String}> = ({title}) =>
|
||||||
|
{
|
||||||
|
return(
|
||||||
|
<View style={styles.textTopView}>
|
||||||
|
<Text style={styles.textTop}>{title}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
import { FC, ReactNode } from "react"
|
||||||
|
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
|
||||||
|
import React from "react"
|
||||||
|
import { Skin } from "../core/skin"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Importing the correct stylesheet
|
||||||
|
*/
|
||||||
|
import styles from "./style/Skin.style"
|
||||||
|
|
||||||
|
export const SkinComponent :
|
||||||
|
/* Parameters :
|
||||||
|
* skin : Skin to be displayed
|
||||||
|
* state : Indicates from wich screen the component has been called
|
||||||
|
*/
|
||||||
|
FC<{skin: Skin, state: String}> =
|
||||||
|
({skin, state}) =>
|
||||||
|
{
|
||||||
|
/* The display of this component depends of the screen from where it has been called:
|
||||||
|
* From the TopBar (icon) : Small image in a circle
|
||||||
|
* From the shop (shop) : Image + Name + Price, Pressable => Buy the skin
|
||||||
|
* From the profile (profile) : Name + Image, Pressable => Change the skin
|
||||||
|
*/
|
||||||
|
switch (state) {
|
||||||
|
case 'icon':
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<Image source={ skin.getSkinSource()} style={styles.icon}/>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
|
||||||
|
case 'shop':
|
||||||
|
return(
|
||||||
|
<Pressable onPress={() => Alert.alert("Achat du skin")} style={styles.imageWrapper}>
|
||||||
|
<Text style={styles.nomSkin}>{skin.getSkinName()}</Text>
|
||||||
|
<Image
|
||||||
|
style={styles.imageSkin}
|
||||||
|
source={skin.getSkinSource()}
|
||||||
|
/>
|
||||||
|
<Text style={styles.nomSkin}>100€</Text>
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
case 'liste':
|
||||||
|
return(
|
||||||
|
<Pressable onPress={() => Alert.alert("Changement du skin")} style={styles.imageWrapper}>
|
||||||
|
<Text style={styles.nomSkin}>{skin.getSkinName()}</Text>
|
||||||
|
<Image
|
||||||
|
style={styles.imageSkin}
|
||||||
|
source={skin.getSkinSource()}
|
||||||
|
/>
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
case 'profile':
|
||||||
|
return(
|
||||||
|
<Pressable onPress={() => Alert.alert("Achat du skin")} style={styles.imageWrapperProfil}>
|
||||||
|
<Text style={styles.nomSkin}>{skin.getSkinName()}</Text>
|
||||||
|
<Image
|
||||||
|
style={styles.imageSkin}
|
||||||
|
source={skin.getSkinSource()}
|
||||||
|
/>
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
@ -1,23 +1,59 @@
|
|||||||
import { FC, ReactNode } from "react"
|
import { FC, ReactNode } from "react"
|
||||||
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
|
import { Pressable, Image, Text, View} from "react-native"
|
||||||
import { Skin } from "../core/Skin"
|
import { Skin } from "../core/Skin"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import { SkinComponent } from "./skinAvatar"
|
import { SkinComponent } from "./Skin"
|
||||||
import MainTabNavigator from "../navigation/AppNavigator"
|
|
||||||
import { BottomTabNavigationProp } from "@react-navigation/bottom-tabs"
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Import the correct stylesheet
|
||||||
|
*/
|
||||||
|
import styles from './style/TopBar.style';
|
||||||
|
|
||||||
export const TopBar : FC<{skin: Skin, styleAvatar: ImageStyle, title: String, rightIcon: ImageSourcePropType, styleIcon: ImageStyle,nav: any, styleTitle: TextStyle, styleHeader : any}> = ({skin, styleAvatar, title, rightIcon,styleIcon, nav, styleTitle, styleHeader}) =>
|
/*
|
||||||
|
Images required
|
||||||
|
*/
|
||||||
|
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
|
||||||
|
const cross = require('../../assets/Icons/UnSelected/Cross.png');
|
||||||
|
const msc = require('../../assets/Icons/FondGris.png');
|
||||||
|
|
||||||
|
export const TopBar :
|
||||||
|
/* Parameters:
|
||||||
|
* skin : optional skin to display
|
||||||
|
* nav : tool needed to allow the navigation between the screens
|
||||||
|
* state : optional parameter that indicates from which screen the component has been called
|
||||||
|
(the string must be the name of the screen)
|
||||||
|
*/
|
||||||
|
FC<{skin?: Skin, nav: any, state?: string}> =
|
||||||
|
({skin, nav, state}) =>
|
||||||
{
|
{
|
||||||
|
/* The display of this component depends of the screen from where it has been called:
|
||||||
|
* From the Settings (icon) : Name of the page + cross button
|
||||||
|
* From other : skin + Title + parameters icon
|
||||||
|
*/
|
||||||
|
switch (state) {
|
||||||
|
case 'settings':
|
||||||
return (
|
return (
|
||||||
<View style={styleHeader}>
|
<View style={styles.header}>
|
||||||
<Pressable onPress={() => nav.navigate('ProfileTab')}>
|
<Pressable>
|
||||||
<SkinComponent skin={skin} children={styleAvatar} />
|
<Image source={msc} style={styles.icon}/>
|
||||||
|
</Pressable>
|
||||||
|
<Text style={styles.titre}>BOB PARTY</Text>
|
||||||
|
<Pressable onPress={() => nav.goBack()}>
|
||||||
|
<Image source={cross} style={styles.icon}/>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<Text style={styleTitle}>{title}</Text>
|
</View>
|
||||||
|
)
|
||||||
|
default:
|
||||||
|
return (
|
||||||
|
<View style={styles.header}>
|
||||||
|
<Pressable onPress={() => nav.navigate('ProfileTab', {screen: 'Profile'})}>
|
||||||
|
<SkinComponent skin={skin} state='icon' />
|
||||||
|
</Pressable>
|
||||||
|
<Text style={styles.titre}>BOB PARTY</Text>
|
||||||
<Pressable onPress={() => nav.navigate('Settings')}>
|
<Pressable onPress={() => nav.navigate('Settings')}>
|
||||||
<Image source={rightIcon} style={styleIcon}/>
|
<Image source={engrenage} style={styles.icon}/>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
import { FC, ReactNode } from "react"
|
|
||||||
import { Button, Image, ImageStyle, Text, View } from "react-native"
|
|
||||||
import { Skin } from "../core/Skin"
|
|
||||||
import React from "react"
|
|
||||||
|
|
||||||
export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => {
|
|
||||||
return (
|
|
||||||
<View>
|
|
||||||
<Image source={ skin.getSkinSource()} style={children}/>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
@ -0,0 +1,20 @@
|
|||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
/*
|
||||||
|
Stylesheet for the BotBar component
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
footer: {
|
||||||
|
flex: 0.15,
|
||||||
|
flexDirection: 'row',
|
||||||
|
backgroundColor: '#2D2C33',
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-evenly',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
width: 65,
|
||||||
|
height: 65,
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,20 @@
|
|||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
button: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: 3,
|
||||||
|
marginTop: 5,
|
||||||
|
marginHorizontal: 10,
|
||||||
|
borderRadius: 10,
|
||||||
|
backgroundColor: '#2D2C33',
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,25 @@
|
|||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
/*
|
||||||
|
Stylesheet for the ButtonGameTypeChoice component
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
button: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: '30%',
|
||||||
|
width: '70%',
|
||||||
|
margin: '5%',
|
||||||
|
borderRadius: 10,
|
||||||
|
elevation: 3,
|
||||||
|
backgroundColor: '#0085FF',
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,15 @@
|
|||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
textNom: {
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
textMess: {
|
||||||
|
fontSize: 15,
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: '#D9D9D9',
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,24 @@
|
|||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Stylesheet for the GameComponent component
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default StyleSheet.create(
|
||||||
|
{
|
||||||
|
image : {
|
||||||
|
borderRadius: 15,
|
||||||
|
marginTop: 15,
|
||||||
|
marginRight: 15,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
},
|
||||||
|
name :{
|
||||||
|
textAlign: 'center',
|
||||||
|
fontSize: 15,
|
||||||
|
fontFamily: 'Helvetica',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
})
|
@ -0,0 +1,21 @@
|
|||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
textTop: {
|
||||||
|
textAlign: "center",
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
textTopView: {
|
||||||
|
backgroundColor: '#0085FF',
|
||||||
|
width: '30%',
|
||||||
|
padding: 5,
|
||||||
|
paddingBottom: 10,
|
||||||
|
alignSelf: 'center',
|
||||||
|
borderBottomRightRadius: 50,
|
||||||
|
borderBottomLeftRadius: 50,
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,36 @@
|
|||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Stylesheet for the Skin component
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
icon: {
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
borderRadius: 50,
|
||||||
|
},
|
||||||
|
imageWrapper: {
|
||||||
|
height: 135,
|
||||||
|
width: '40%',
|
||||||
|
flexDirection: "column",
|
||||||
|
margin: 10,
|
||||||
|
},
|
||||||
|
imageWrapperProfil: {
|
||||||
|
height: 135,
|
||||||
|
flexDirection: "column",
|
||||||
|
margin: 10,
|
||||||
|
},
|
||||||
|
imageSkin : {
|
||||||
|
borderRadius: 15,
|
||||||
|
width: '100%',
|
||||||
|
flex:1
|
||||||
|
},
|
||||||
|
nomSkin :{
|
||||||
|
textAlign: 'center',
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: 'Helvetica',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,35 @@
|
|||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
/*
|
||||||
|
Stylesheet for the TopBar component
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
header: {
|
||||||
|
flex: 0.15,
|
||||||
|
flexDirection: 'row',
|
||||||
|
backgroundColor: '#2D2C33',
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-evenly',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
avatar: {
|
||||||
|
borderRadius: 50,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
},
|
||||||
|
titre: {
|
||||||
|
flex: 0.7,
|
||||||
|
flexDirection: 'column',
|
||||||
|
textAlign: 'center',
|
||||||
|
fontSize: 30,
|
||||||
|
fontFamily: 'Helvetica',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,25 @@
|
|||||||
|
import { Message } from "./core/message"
|
||||||
|
import { Conversation } from "./core/conversation"
|
||||||
|
import tabSkinApp from './constSkin'
|
||||||
|
import { User } from "./core/user";
|
||||||
|
|
||||||
|
|
||||||
|
let UserActu:User=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, undefined);
|
||||||
|
let UserTest:User=new User("48", "Wesh Wesh", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[1], tabSkinApp, undefined);
|
||||||
|
|
||||||
|
let tabMessageTest:Message[]=[
|
||||||
|
new Message("Salut", UserActu, new Date(2022,12,12)),
|
||||||
|
new Message("Wesh", UserTest, new Date(2022,12,13)),
|
||||||
|
new Message("Ca va", UserActu, new Date(2022,12,14)),
|
||||||
|
new Message("Ouais et toi?", UserTest, new Date(2022,12,15)),
|
||||||
|
]
|
||||||
|
|
||||||
|
let tabUS:User[]=[UserActu, UserTest];
|
||||||
|
|
||||||
|
let conv = new Conversation(tabUS, tabMessageTest, "le super nom");
|
||||||
|
|
||||||
|
let tabConv:Conversation[]=[conv];
|
||||||
|
|
||||||
|
export default tabConv;
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
import { Skin } from "./core/skin";
|
||||||
|
|
||||||
|
let tabSkinApp:Skin[]=[
|
||||||
|
new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0),
|
||||||
|
new Skin("S0002", "Bob Blue",require('bob_party/assets/BobsSkins/BobBlue.png'), 100),
|
||||||
|
new Skin("S0003", "Bob BW",require('bob_party/assets/BobsSkins/BobBW.png'), 100),
|
||||||
|
new Skin("S0004", "Bob Green",require('bob_party/assets/BobsSkins/BobGreen.png'), 100),
|
||||||
|
new Skin("S0005", "Bob P&T",require('bob_party/assets/BobsSkins/BobPinkTurquoise.png'), 100),
|
||||||
|
new Skin("S0006", "Bob Red",require('bob_party/assets/BobsSkins/BobRed.png'), 100),
|
||||||
|
new Skin("S0007", "Bob Cute",require('bob_party/assets/BobsSkins/BobYellowGreenBlueHeart.png'), 100),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
export default tabSkinApp;
|
@ -1,35 +1,45 @@
|
|||||||
export interface Game{
|
import { randomBytes } from "crypto";
|
||||||
private Name:String;
|
import { ImageSourcePropType } from "react-native";
|
||||||
private ImageSource:String;
|
|
||||||
private GameSource:String;
|
|
||||||
|
|
||||||
constructor(name:String, imageSource:String, gameSource:String){
|
export class Game{
|
||||||
|
private Name:string;
|
||||||
|
private ImageSource:ImageSourcePropType;
|
||||||
|
private GameSource:string ;
|
||||||
|
|
||||||
|
/* Constructor of the class */
|
||||||
|
constructor (name:string, imageSource:ImageSourcePropType, gameSource:string){
|
||||||
this.Name=name;
|
this.Name=name;
|
||||||
this.ImageSource=imageSource
|
this.ImageSource=imageSource;
|
||||||
this.GameSource=gameSource;
|
this.GameSource=gameSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the name of a game */
|
||||||
getName(){
|
getName(){
|
||||||
return this.Name;
|
return this.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
setName(name:String){
|
/* Brief : Function setting the name of a game */
|
||||||
|
setName(name:string){
|
||||||
this.Name=name;
|
this.Name=name;
|
||||||
}
|
}
|
||||||
|
|
||||||
getImageSource(imageSource:String){
|
/* Brief : Function getting the image of a game */
|
||||||
|
getImageSource(){
|
||||||
return this.ImageSource;
|
return this.ImageSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
setImageSource(imageSource:String){
|
/* Brief : Function setting the image of a game */
|
||||||
|
setImageSource(imageSource:ImageSourcePropType){
|
||||||
this.ImageSource=imageSource;
|
this.ImageSource=imageSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the source of a game */
|
||||||
getGameSource(){
|
getGameSource(){
|
||||||
return this.GameSource;
|
return this.GameSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
setGameSource(gameSource:String){
|
/* Brief : Function getting the source of a game */
|
||||||
|
setGameSource(gameSource:string){
|
||||||
this.GameSource=gameSource;
|
this.GameSource=gameSource;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
import { ImageSourcePropType } from 'react-native';
|
||||||
|
import { Game } from './game'
|
||||||
|
|
||||||
|
export class GameSolo extends Game{
|
||||||
|
readonly PtsToCoins:Map<number,number>
|
||||||
|
|
||||||
|
constructor(name:string, imageSource:ImageSourcePropType, gameSource:string, ptsToCoins:Map<number,number>){
|
||||||
|
super(name, imageSource, gameSource);
|
||||||
|
this.PtsToCoins=ptsToCoins;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getSoloMap(){
|
||||||
|
return this.PtsToCoins;
|
||||||
|
}
|
||||||
|
|
||||||
|
CoinsWithPoints(nbPoints:number){
|
||||||
|
let coins;
|
||||||
|
for (let key of this.PtsToCoins.keys()){
|
||||||
|
coins = this.PtsToCoins.get(key);
|
||||||
|
if (nbPoints<key ){
|
||||||
|
return coins;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return coins;
|
||||||
|
}
|
||||||
|
}
|
@ -1,25 +1,51 @@
|
|||||||
|
import { ImageSourcePropType } from "react-native";
|
||||||
|
|
||||||
export class Skin{
|
export class Skin{
|
||||||
|
readonly Id: string;
|
||||||
private Name: string;
|
private Name: string;
|
||||||
private Source: any;
|
private Source: ImageSourcePropType;
|
||||||
|
private Cost:number;
|
||||||
|
|
||||||
constructor(name: string, source:any){
|
/* Constructor of the class */
|
||||||
|
constructor(id:string, name: string, source:ImageSourcePropType, Cost:number){
|
||||||
|
this.Id=id;
|
||||||
this.Name=name;
|
this.Name=name;
|
||||||
this.Source=source;
|
this.Source=source;
|
||||||
|
this.Cost=Cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Fuction setting the name of a skin */
|
||||||
setSkinName(name: string){
|
setSkinName(name: string){
|
||||||
this.Name=name;
|
this.Name=name;
|
||||||
}
|
}
|
||||||
|
|
||||||
setSkinSource(source: any){
|
/* Brief : Fuction setting the source of the image of a skin */
|
||||||
|
setSkinSource(source: ImageSourcePropType){
|
||||||
this.Source=source;
|
this.Source=source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Fuction getting the source of the image of a skin */
|
||||||
getSkinSource(){
|
getSkinSource(){
|
||||||
return this.Source;
|
return this.Source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Fuction getting the name of a skin */
|
||||||
getSkinName(){
|
getSkinName(){
|
||||||
return this.Name;
|
return this.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Fuction getting the id of a skin */
|
||||||
|
getSkinId(){
|
||||||
|
return this.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Brief : Fuction getting the cost of a skin */
|
||||||
|
getSkinCost(){
|
||||||
|
return this.Cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Brief : Fuction getting the cost of a skin */
|
||||||
|
setSkinCost(cost:number){
|
||||||
|
this.Cost=cost;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,109 +1,161 @@
|
|||||||
import { Skin } from './Skin'
|
import { Skin } from './Skin'
|
||||||
import { Conversation } from './conversation';
|
import { Conversation } from './conversation';
|
||||||
|
import { sign } from 'crypto';
|
||||||
|
|
||||||
export class User{
|
export class User{
|
||||||
private Id: string;
|
readonly Id: string;
|
||||||
private Username: string;
|
private Username: string;
|
||||||
private Nationality: string;
|
private Nationality: string;
|
||||||
private Sexe: string;
|
private Sexe: string;
|
||||||
private DateOfBirth: Date;
|
private DateOfBirth: Date;
|
||||||
private CurrentCoins: number;
|
private CurrentCoins: number;
|
||||||
private TotalCoins: number;
|
private TotalCoins: number;
|
||||||
|
private NbGamePlayed: number;
|
||||||
private CurrentSkin: Skin;
|
private CurrentSkin: Skin;
|
||||||
private TabSkin: Skin[];
|
private TabSkin: Skin[];
|
||||||
private TabConv: Conversation[];
|
private TabConv?: Conversation[];
|
||||||
|
|
||||||
|
/* Consturctor of the class */
|
||||||
constructor(id: string, username: string, nationality: string, sexe: string, dateOfBirth: Date, currentCoins: number, totalCoins: number,
|
constructor(id: string, username: string, nationality: string, sexe: string, dateOfBirth: Date, currentCoins: number, totalCoins: number,
|
||||||
currentSkin: Skin, tabSkin: Skin[], tabConv: Conversation[] ){
|
nbGamePlayed:number, currentSkin: Skin, tabSkin: Skin[], tabConv?: Conversation[] ){
|
||||||
this.Id=id;
|
this.Id=id;
|
||||||
this.Username=username;
|
this.Username=username;
|
||||||
this.Nationality=nationality;
|
this.Nationality=nationality;
|
||||||
this.Sexe=sexe;
|
this.Sexe=sexe;
|
||||||
this.DateOfBirth=dateOfBirth;
|
this.DateOfBirth=dateOfBirth;
|
||||||
|
this.NbGamePlayed=nbGamePlayed;
|
||||||
this.CurrentCoins=currentCoins;
|
this.CurrentCoins=currentCoins;
|
||||||
this.TotalCoins=totalCoins;
|
this.TotalCoins=totalCoins;
|
||||||
this.CurrentSkin=currentSkin;
|
this.CurrentSkin=currentSkin;
|
||||||
this.TabSkin=[...tabSkin];
|
this.TabSkin=[...tabSkin];
|
||||||
this.TabConv=[...tabConv];
|
tabConv?.forEach(conv => {
|
||||||
|
this.TabConv?.push(conv);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the name of an user */
|
||||||
getUsername(){
|
getUsername(){
|
||||||
return this.Username;
|
return this.Username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the name of an user */
|
||||||
setUsername(username: string){
|
setUsername(username: string){
|
||||||
this.Username=username;
|
this.Username=username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the id of an user */
|
||||||
getId(){
|
getId(){
|
||||||
return this.Id;
|
return this.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
setId(id: string){
|
/* Brief : Function getting the current number of coins of an user */
|
||||||
this.Id=id;
|
|
||||||
}
|
|
||||||
|
|
||||||
getCurrentCoins(){
|
getCurrentCoins(){
|
||||||
return this.CurrentCoins;
|
return this.CurrentCoins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the current number of coins of an user */
|
||||||
setCurrentCoins(currentCoins: number){
|
setCurrentCoins(currentCoins: number){
|
||||||
this.CurrentCoins=currentCoins;
|
this.CurrentCoins=currentCoins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the sex of an user */
|
||||||
getSexe(){
|
getSexe(){
|
||||||
return this.Sexe;
|
return this.Sexe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the sex of an user */
|
||||||
setSexe(sexe: string){
|
setSexe(sexe: string){
|
||||||
this.Sexe=sexe;
|
this.Sexe=sexe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the date of birth of an user */
|
||||||
getDateOfBirth(){
|
getDateOfBirth(){
|
||||||
return this.DateOfBirth;
|
return this.DateOfBirth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the date of birth of an user */
|
||||||
setDateOfBirth(dateOfBirth: Date){
|
setDateOfBirth(dateOfBirth: Date){
|
||||||
this.DateOfBirth=dateOfBirth;
|
this.DateOfBirth=dateOfBirth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the nationality of an user */
|
||||||
getNationality(){
|
getNationality(){
|
||||||
return this.Nationality;
|
return this.Nationality;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the nationality of an user */
|
||||||
setNationality(nationality: string){
|
setNationality(nationality: string){
|
||||||
this.Nationality=nationality;
|
this.Nationality=nationality;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the total number of coins of an user */
|
||||||
getTotalCoins(){
|
getTotalCoins(){
|
||||||
return this.TotalCoins;
|
return this.TotalCoins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the total number of coins of an user */
|
||||||
setTotalCoins(totalCoins: number){
|
setTotalCoins(totalCoins: number){
|
||||||
this.TotalCoins=totalCoins;
|
this.TotalCoins=totalCoins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the current number of game played by an user */
|
||||||
|
|
||||||
|
getGamePlayed(){
|
||||||
|
return this.NbGamePlayed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the current number of game played by an user */
|
||||||
|
|
||||||
|
setGamePlayed(nb: number){
|
||||||
|
this.NbGamePlayed=nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the current skin of an user */
|
||||||
|
|
||||||
getCurrentSkin(){
|
getCurrentSkin(){
|
||||||
return this.CurrentSkin;
|
return this.CurrentSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the current skin of an user */
|
||||||
setCurrentSkin(newSkin: Skin){
|
setCurrentSkin(newSkin: Skin){
|
||||||
this.CurrentSkin=newSkin;
|
this.CurrentSkin=newSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the skins of an user */
|
||||||
getTabSkin(){
|
getTabSkin(){
|
||||||
return this.TabSkin;
|
return this.TabSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function setting the skins of an user */
|
||||||
setTabSkin(tabSkin: Skin[]){
|
setTabSkin(tabSkin: Skin[]){
|
||||||
this.TabSkin=[...tabSkin];
|
this.TabSkin=[...tabSkin];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Brief : Function getting the conversations of an user */
|
||||||
getTabConv(){
|
getTabConv(){
|
||||||
return this.TabConv;
|
return this.TabConv;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTabConv(tabConv: Conversation[]){
|
/* Brief : Function setting the conversations of an user */
|
||||||
this.TabConv=[...tabConv];
|
setTabConv(tabConv?: Conversation[]){
|
||||||
|
tabConv?.forEach(conv => {
|
||||||
|
this.TabConv?.push(conv);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeUserCoins(coin:number){
|
||||||
|
this.CurrentCoins+=coin;
|
||||||
|
if (coin>0){
|
||||||
|
this.TotalCoins+=coin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
changerCurrentSkin(skin:Skin){
|
||||||
|
this.CurrentSkin=skin;
|
||||||
|
}
|
||||||
|
|
||||||
|
ajouterSkin(skin:Skin){
|
||||||
|
this.TabSkin.push(skin);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,142 +1,41 @@
|
|||||||
import { StatusBar } from 'expo-status-bar'
|
import { StatusBar } from 'expo-status-bar'
|
||||||
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
|
import { StyleSheet, View, Text} from 'react-native'
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import stylesScreen from './style/screens.style'
|
||||||
import { Skin } from '../core/skin';
|
import { Skin } from '../core/skin';
|
||||||
import { TopBar } from '../components/TopBar';
|
import { TopBar } from '../components/TopBar';
|
||||||
import { BotBar } from '../components/BotBar';
|
import { BotBar } from '../components/BotBar';
|
||||||
|
import { ScreenIndicator } from '../components/ScreenIndicator';
|
||||||
|
import { User } from '../core/user';
|
||||||
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
|
import { ConversationComponent } from '../components/ConversationComponent';
|
||||||
|
|
||||||
const avatar = require('../../assets/Icons/BobClassic.png');
|
import tabSkinApp from '../constSkin';
|
||||||
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
|
import tabConv from '../constCov';
|
||||||
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
|
|
||||||
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png');
|
|
||||||
const message = require('../../assets/Icons/Selected/SChat.png');
|
const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv);
|
||||||
const store = require('../../assets/Icons/UnSelected/Store.png');
|
|
||||||
|
|
||||||
function Chat(props: { navigation: any; }) {
|
function Chat(props: { navigation: any; }) {
|
||||||
const { navigation } = props
|
const { navigation } = props
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={stylesScreen.container}>
|
||||||
<TopBar
|
<TopBar
|
||||||
skin={skinTest}
|
skin={UserActu.getCurrentSkin()}
|
||||||
styleAvatar={styles.avatar}
|
nav={navigation}
|
||||||
title="BOB PARTY"
|
/>
|
||||||
rightIcon={engrenage}
|
<View style={stylesScreen.bodyStart}>
|
||||||
styleIcon={styles.engrenage}
|
<FlatList
|
||||||
nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
|
data={tabConv}
|
||||||
|
renderItem={({item}) => <ConversationComponent conv={item} state='Preview'/>}
|
||||||
/>
|
/>
|
||||||
<View style={styles.body}>
|
|
||||||
<Text style={styles.text}>couille</Text>
|
|
||||||
</View>
|
</View>
|
||||||
<BotBar
|
<BotBar
|
||||||
messages={message}
|
|
||||||
games={gamepad}
|
|
||||||
shop={store}
|
|
||||||
style={styles.iconFooter}
|
|
||||||
styleStore={styles.iconStore}
|
|
||||||
nav={navigation}
|
nav={navigation}
|
||||||
styleBar={styles.footer}
|
state='Chat'
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Button(props: { onPress: any; title?: "Save" | undefined; }) {
|
|
||||||
const { onPress, title = 'Save' } = props;
|
|
||||||
return (
|
|
||||||
<Pressable style={styles.button} onPress={onPress}>
|
|
||||||
<Text style={styles.text}>{title}</Text>
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
body: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
width: '70%',
|
|
||||||
},
|
|
||||||
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: "#45444E",
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
alignItems: "center",
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '30%',
|
|
||||||
width: '100%',
|
|
||||||
marginTop: '10%',
|
|
||||||
paddingVertical: 12,
|
|
||||||
paddingHorizontal: 32,
|
|
||||||
borderRadius: 10,
|
|
||||||
elevation: 3,
|
|
||||||
backgroundColor: '#0085FF',
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
fontSize: 16,
|
|
||||||
lineHeight: 21,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
flex : 0.15,
|
|
||||||
width: '100%',
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
titre: {
|
|
||||||
flex: 0.7,
|
|
||||||
flexDirection: 'column',
|
|
||||||
textAlign: 'center',
|
|
||||||
fontSize: 30,
|
|
||||||
fontFamily: 'Helvetica',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
engrenage: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
avatar: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
footer: {
|
|
||||||
flex: 0.15,
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-evenly',
|
|
||||||
},
|
|
||||||
iconFooter: {
|
|
||||||
marginBot: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
width: 65,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
iconStore: {
|
|
||||||
marginBot: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
marginLeft: 7,
|
|
||||||
marginRight: 8,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Chat
|
export default Chat
|
@ -0,0 +1,155 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar'
|
||||||
|
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
|
||||||
|
import React from 'react';
|
||||||
|
import { Game } from '../core/Game';
|
||||||
|
import { Skin } from '../core/skin';
|
||||||
|
import { TopBar } from '../components/TopBar';
|
||||||
|
import { BotBar } from '../components/BotBar';
|
||||||
|
import { GameComponent } from '../components/GameComponent';
|
||||||
|
import { User } from '../core/user';
|
||||||
|
import tabSkinApp from '../constSkin';
|
||||||
|
import { Conversation } from '../core/conversation';
|
||||||
|
let tabConv:Conversation[]=[];
|
||||||
|
|
||||||
|
|
||||||
|
const msc = require('../../assets/Icons/FondGris.png');
|
||||||
|
|
||||||
|
const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv);
|
||||||
|
const jeuTest= new Game("SNAKE", require('../../assets/Icons/UnSelected/Gamepad.png'),"ouin");
|
||||||
|
function GameChoice(props: { navigation: any; }) {
|
||||||
|
const { navigation } = props
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<TopBar
|
||||||
|
skin={UserActu.getCurrentSkin()}
|
||||||
|
nav={navigation}
|
||||||
|
/>
|
||||||
|
<View style={styles.body}>
|
||||||
|
<GameComponent
|
||||||
|
game={jeuTest}
|
||||||
|
nav={navigation}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<BotBar
|
||||||
|
nav={navigation}
|
||||||
|
state='Home'
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Button(props: { onPress: any; title?: any | undefined; }) {
|
||||||
|
const { onPress, title = 'Save' } = props;
|
||||||
|
return (
|
||||||
|
<Pressable style={styles.button} onPress={onPress}>
|
||||||
|
<Text style={styles.text}>{title}</Text>
|
||||||
|
</Pressable>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
body: {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: 'column',
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
width: '70%',
|
||||||
|
},
|
||||||
|
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: "#45444E",
|
||||||
|
flexDirection: "column",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
height: '30%',
|
||||||
|
width: '100%',
|
||||||
|
marginTop: '10%',
|
||||||
|
paddingVertical: 12,
|
||||||
|
paddingHorizontal: 32,
|
||||||
|
borderRadius: 10,
|
||||||
|
elevation: 3,
|
||||||
|
backgroundColor: '#0085FF',
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
flex : 0.15,
|
||||||
|
width: '100%',
|
||||||
|
flexDirection: 'row',
|
||||||
|
backgroundColor: '#2D2C33',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-around',
|
||||||
|
},
|
||||||
|
titre: {
|
||||||
|
flex: 0.7,
|
||||||
|
flexDirection: 'column',
|
||||||
|
textAlign: 'center',
|
||||||
|
fontSize: 30,
|
||||||
|
fontFamily: 'Helvetica',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
engrenage: {
|
||||||
|
borderRadius: 50,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
},
|
||||||
|
avatar: {
|
||||||
|
borderRadius: 50,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
},
|
||||||
|
|
||||||
|
footer: {
|
||||||
|
flex: 0.15,
|
||||||
|
flexDirection: 'row',
|
||||||
|
backgroundColor: '#2D2C33',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-evenly',
|
||||||
|
},
|
||||||
|
iconFooter: {
|
||||||
|
marginBottom: 25,
|
||||||
|
marginTop: 10,
|
||||||
|
width: 65,
|
||||||
|
height: 50,
|
||||||
|
},
|
||||||
|
iconStore: {
|
||||||
|
marginBottom: 25,
|
||||||
|
marginTop: 10,
|
||||||
|
marginLeft: 7,
|
||||||
|
marginRight: 8,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
},
|
||||||
|
imageSkin : {
|
||||||
|
borderRadius: 15,
|
||||||
|
marginTop: 15,
|
||||||
|
marginRight: 15,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
},
|
||||||
|
nomSkin :{
|
||||||
|
textAlign: 'center',
|
||||||
|
fontSize: 15,
|
||||||
|
fontFamily: 'Helvetica',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
export default GameChoice
|
@ -1,161 +1,47 @@
|
|||||||
import { StatusBar } from 'expo-status-bar'
|
import { StatusBar } from 'expo-status-bar'
|
||||||
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
|
import { StyleSheet, View, ImageSourcePropType} from 'react-native'
|
||||||
import React, { Children } from 'react';
|
import React from 'react';
|
||||||
import { SkinComponent } from '../components/skinAvatar';
|
import stylesScreen from './style/screens.style'
|
||||||
import { User } from '../core/user';
|
import { User } from '../core/user';
|
||||||
import { Skin } from '../core/skin';
|
import { Skin } from '../core/skin';
|
||||||
import { TopBar } from '../components/TopBar';
|
import { TopBar } from '../components/TopBar';
|
||||||
import { BotBar } from '../components/BotBar';
|
import { BotBar } from '../components/BotBar';
|
||||||
import { Conversation } from '../core/conversation';
|
import { Conversation } from '../core/conversation';
|
||||||
|
import { ButtonGameTypeChoice } from '../components/ButtonGameTypeChoice';
|
||||||
|
import tabSkinApp from '../constSkin';
|
||||||
|
import { GameSolo } from '../core/gameSolo';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const avatar = require('../../assets/Icons/BobClassic.png');
|
//const test= new GameSolo("test", require('bob_party/assets/ImagesJeux/BatailleNavale.jpeg'), "test", );
|
||||||
let tabSkin:Skin[];
|
|
||||||
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
|
|
||||||
const skinTest2= new Skin("wesh",require('../../assets/BobsSkins/BobBlue.png'));
|
|
||||||
tabSkin=[skinTest];
|
|
||||||
tabSkin.push(skinTest2);
|
|
||||||
let tabConv:Conversation[]=[];
|
let tabConv:Conversation[]=[];
|
||||||
const UserActu=new User("14", "leBg", "ouioui", "grand", "la", 12222, 123324, skinTest, tabSkin, tabConv);
|
const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv);
|
||||||
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
|
|
||||||
const gamepad = require('../../assets/Icons/Selected/SGamepad.png');
|
|
||||||
const message = require('../../assets/Icons/UnSelected/Chat.png');
|
|
||||||
const store = require('../../assets/Icons/UnSelected/Store.png');
|
|
||||||
|
|
||||||
|
|
||||||
function Home(props: { navigation: any; }) {
|
function Home(props: { navigation: any; }) {
|
||||||
const { navigation } = props
|
const { navigation } = props
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={stylesScreen.container}>
|
||||||
<TopBar
|
<TopBar
|
||||||
skin={skinTest}
|
skin={UserActu.getCurrentSkin()}
|
||||||
styleAvatar={styles.avatar}
|
|
||||||
title="BOB PARTY"
|
|
||||||
rightIcon={engrenage}
|
|
||||||
styleIcon={styles.engrenage}
|
|
||||||
nav={navigation}
|
nav={navigation}
|
||||||
styleTitle={styles.titre}
|
state= 'Home'
|
||||||
styleHeader={styles.header}
|
|
||||||
/>
|
/>
|
||||||
<View style={styles.body}>
|
<View style={stylesScreen.bodyCenter}>
|
||||||
<Button
|
<ButtonGameTypeChoice
|
||||||
title='Jouer Seul'
|
title='Jouer Seul'
|
||||||
onPress={() => Alert.alert('On Joue seul')}
|
onPress={() => navigation.navigate('GameChoice')}
|
||||||
/>
|
/>
|
||||||
<Button
|
<ButtonGameTypeChoice
|
||||||
title='Défier mes amis'
|
title='Défier mes amis'
|
||||||
onPress={() => Alert.alert('On Joue avec les potos')}
|
onPress={() => navigation.navigate('GameChoice')}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<BotBar
|
<BotBar
|
||||||
messages={message}
|
|
||||||
games={gamepad}
|
|
||||||
shop={store}
|
|
||||||
style={styles.iconFooter}
|
|
||||||
styleStore={styles.iconStore}
|
|
||||||
nav={navigation}
|
nav={navigation}
|
||||||
styleBar={styles.footer}
|
state='Home'
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Button(props: { onPress: any; title?: any | undefined; }) {
|
|
||||||
const { onPress, title = 'Save' } = props;
|
|
||||||
return (
|
|
||||||
<Pressable style={styles.button} onPress={onPress}>
|
|
||||||
<Text style={styles.text}>{title}</Text>
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: '#45444E',
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
alignItems: "center",
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '30%',
|
|
||||||
width: '100%',
|
|
||||||
marginTop: '10%',
|
|
||||||
paddingVertical: 12,
|
|
||||||
paddingHorizontal: 32,
|
|
||||||
borderRadius: 10,
|
|
||||||
elevation: 3,
|
|
||||||
backgroundColor: '#0085FF',
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
fontSize: 16,
|
|
||||||
lineHeight: 21,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
flex : 0.15,
|
|
||||||
width: '100%',
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
titre: {
|
|
||||||
flex: 0.7,
|
|
||||||
flexDirection: 'column',
|
|
||||||
textAlign: 'center',
|
|
||||||
fontSize: 30,
|
|
||||||
fontFamily: 'Helvetica',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
engrenage: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
avatar: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
body: {
|
|
||||||
flex: 1,
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
width: '70%',
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
flex: 0.15,
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-evenly',
|
|
||||||
},
|
|
||||||
iconFooter: {
|
|
||||||
marginBot: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
width: 65,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
iconStore: {
|
|
||||||
marginBot: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
marginLeft: 7,
|
|
||||||
marginRight: 8,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Home
|
export default Home
|
@ -1,144 +1,54 @@
|
|||||||
import { StatusBar } from 'expo-status-bar'
|
import { StatusBar } from 'expo-status-bar'
|
||||||
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
|
import { StyleSheet, View, Text, Image} from 'react-native'
|
||||||
import React, { Children } from 'react';
|
import React from 'react';
|
||||||
import { SkinComponent } from '../components/skinAvatar';
|
import stylesScreen from './style/screens.style'
|
||||||
import { User } from '../core/user';
|
import styles from './style/Profile.style'
|
||||||
import { Skin } from '../core/skin';
|
|
||||||
import { TopBar } from '../components/TopBar';
|
import { TopBar } from '../components/TopBar';
|
||||||
import { BotBar } from '../components/BotBar';
|
import { BotBar } from '../components/BotBar';
|
||||||
|
import { SkinComponent } from '../components/Skin';
|
||||||
|
import { User } from '../core/user';
|
||||||
|
import tabSkinApp from '../constSkin';
|
||||||
|
import tabConv from '../constCov'
|
||||||
|
import { ButtonChangeSkin } from '../components/ButtonChangeSkin';
|
||||||
|
import { ScreenIndicator } from '../components/ScreenIndicator';
|
||||||
|
|
||||||
|
const coin = require('../../assets/Icons/Coin.png')
|
||||||
|
|
||||||
const avatar = require('../../assets/Icons/BobClassic.png');
|
const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 12, tabSkinApp[0], tabSkinApp, tabConv);
|
||||||
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
|
|
||||||
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
|
|
||||||
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png');
|
|
||||||
const message = require('../../assets/Icons/UnSelected/Chat.png');
|
|
||||||
const store = require('../../assets/Icons/UnSelected/Store.png');
|
|
||||||
|
|
||||||
function Profile(props: { navigation: any; }) {
|
function Profile(props: { navigation: any; }) {
|
||||||
const { navigation } = props
|
const { navigation } = props
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={stylesScreen.container}>
|
||||||
<TopBar
|
<TopBar
|
||||||
skin={skinTest}
|
skin={UserActu.getCurrentSkin()}
|
||||||
styleAvatar={styles.avatar}
|
nav={navigation}
|
||||||
title="BOB PARTY"
|
/>
|
||||||
rightIcon={engrenage}
|
<View style={stylesScreen.bodyStart}>
|
||||||
styleIcon={styles.engrenage}
|
<ScreenIndicator title='Profil'/>
|
||||||
nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
|
<View style={styles.coinSkinView}>
|
||||||
|
<View style={styles.coinView}>
|
||||||
|
<Image
|
||||||
|
style={styles.coin}
|
||||||
|
source={coin}
|
||||||
/>
|
/>
|
||||||
<View style={styles.body}>
|
<Text style={styles.coinText}>{UserActu.getCurrentCoins()}</Text>
|
||||||
<Text style={styles.text}>couille</Text>
|
</View>
|
||||||
|
<View style={styles.skinView}>
|
||||||
|
<SkinComponent skin={UserActu.getCurrentSkin()} state='profile'/>
|
||||||
|
<ButtonChangeSkin onPress={() => navigation.navigate('SkinList')}/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={styles.infoView}>
|
||||||
|
<Text style={styles.infoText}>Total de BobCoin gagnés: {UserActu.getTotalCoins()}</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<BotBar
|
<BotBar
|
||||||
messages={message}
|
|
||||||
games={gamepad}
|
|
||||||
shop={store}
|
|
||||||
style={styles.iconFooter}
|
|
||||||
styleStore={styles.iconStore}
|
|
||||||
nav={navigation}
|
nav={navigation}
|
||||||
styleBar={styles.footer}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Button(props: { onPress: any; title?: any | undefined; }) {
|
|
||||||
const { onPress, title = 'Save' } = props;
|
|
||||||
return (
|
|
||||||
<Pressable style={styles.button} onPress={onPress}>
|
|
||||||
<Text style={styles.text}>{title}</Text>
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
body: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
width: '70%',
|
|
||||||
},
|
|
||||||
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: "#45444E",
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
alignItems: "center",
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '30%',
|
|
||||||
width: '100%',
|
|
||||||
marginTop: '10%',
|
|
||||||
paddingVertical: 12,
|
|
||||||
paddingHorizontal: 32,
|
|
||||||
borderRadius: 10,
|
|
||||||
elevation: 3,
|
|
||||||
backgroundColor: '#0085FF',
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
fontSize: 16,
|
|
||||||
lineHeight: 21,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
flex : 0.15,
|
|
||||||
width: '100%',
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
titre: {
|
|
||||||
flex: 0.7,
|
|
||||||
flexDirection: 'column',
|
|
||||||
textAlign: 'center',
|
|
||||||
fontSize: 30,
|
|
||||||
fontFamily: 'Helvetica',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
engrenage: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
avatar: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
footer: {
|
|
||||||
flex: 0.15,
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-evenly',
|
|
||||||
},
|
|
||||||
iconFooter: {
|
|
||||||
marginBottom: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
width: 65,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
iconStore: {
|
|
||||||
marginBottom: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
marginLeft: 7,
|
|
||||||
marginRight: 8,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Profile
|
export default Profile
|
@ -1,131 +1,24 @@
|
|||||||
import { StatusBar } from 'expo-status-bar'
|
import { StatusBar } from 'expo-status-bar'
|
||||||
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
|
import { StyleSheet, View, Text} from 'react-native'
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import stylesScreen from './style/screens.style'
|
||||||
|
import { TopBar } from '../components/TopBar';
|
||||||
|
|
||||||
const msc = require('../../assets/Icons/FondGris.png');
|
|
||||||
const engrenage = require('../../assets/Icons/UnSelected/Cross.png');
|
|
||||||
|
|
||||||
function Store(props: { navigation: any; }) {
|
function Store(props: { navigation: any; }) {
|
||||||
const { navigation } = props
|
const { navigation } = props
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={stylesScreen.container}>
|
||||||
<View style={styles.header}>
|
<TopBar
|
||||||
<Image
|
nav={navigation}
|
||||||
style={styles.engrenage}
|
state='settings'
|
||||||
source={msc}
|
|
||||||
/>
|
/>
|
||||||
<Text style={styles.titre}>Paramètres</Text>
|
<View style={stylesScreen.bodyStart}>
|
||||||
<Pressable onPress={() => props.navigation.goBack()}>
|
<Text>couille</Text>
|
||||||
<Image
|
|
||||||
style={styles.engrenage}
|
|
||||||
source={engrenage}
|
|
||||||
/>
|
|
||||||
</Pressable>
|
|
||||||
</View>
|
|
||||||
<View style={styles.body}>
|
|
||||||
<Text style={styles.text}>couille</Text>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Button(props: { onPress: any; title?: any | undefined; }) {
|
|
||||||
const { onPress, title = 'Save' } = props;
|
|
||||||
return (
|
|
||||||
<Pressable style={styles.button} onPress={onPress}>
|
|
||||||
<Text style={styles.text}>{title}</Text>
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
body: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
width: '70%',
|
|
||||||
},
|
|
||||||
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: "#45444E",
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
alignItems: "center",
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '30%',
|
|
||||||
width: '100%',
|
|
||||||
marginTop: '10%',
|
|
||||||
paddingVertical: 12,
|
|
||||||
paddingHorizontal: 32,
|
|
||||||
borderRadius: 10,
|
|
||||||
elevation: 3,
|
|
||||||
backgroundColor: '#0085FF',
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
fontSize: 16,
|
|
||||||
lineHeight: 21,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
flex : 0.15,
|
|
||||||
width: '100%',
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
titre: {
|
|
||||||
flex: 0.7,
|
|
||||||
flexDirection: 'column',
|
|
||||||
textAlign: 'center',
|
|
||||||
fontSize: 30,
|
|
||||||
fontFamily: 'Helvetica',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
engrenage: {
|
|
||||||
borderRadius: 10,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
avatar: {
|
|
||||||
borderRadius: 10,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
footer: {
|
|
||||||
flex: 0.15,
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-evenly',
|
|
||||||
},
|
|
||||||
iconFooter: {
|
|
||||||
marginBottom: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
width: 65,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
iconStore: {
|
|
||||||
marginBottom: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
marginLeft: 7,
|
|
||||||
marginRight: 8,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Store
|
export default Store
|
@ -0,0 +1,38 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar'
|
||||||
|
import { StyleSheet, View, Text} from 'react-native'
|
||||||
|
import React from 'react';
|
||||||
|
import stylesScreen from './style/screens.style'
|
||||||
|
import { Skin } from '../core/skin';
|
||||||
|
import { TopBar } from '../components/TopBar';
|
||||||
|
import { BotBar } from '../components/BotBar';
|
||||||
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
|
import { SkinComponent } from '../components/Skin';
|
||||||
|
import tabSkinApp from '../constSkin';
|
||||||
|
import { ScreenIndicator } from '../components/ScreenIndicator';
|
||||||
|
|
||||||
|
|
||||||
|
function SkinList(props: { navigation: any; }) {
|
||||||
|
const { navigation } = props
|
||||||
|
return (
|
||||||
|
<View style={stylesScreen.container}>
|
||||||
|
<TopBar
|
||||||
|
skin={tabSkinApp[0]}
|
||||||
|
nav={navigation}
|
||||||
|
/>
|
||||||
|
<View style={stylesScreen.bodyStart}>
|
||||||
|
<ScreenIndicator title='Mes Skins'/>
|
||||||
|
<FlatList
|
||||||
|
data={tabSkinApp}
|
||||||
|
numColumns={2}
|
||||||
|
columnWrapperStyle={{ flex: 1, justifyContent: "space-around"}}
|
||||||
|
keyExtractor={item =>item.getSkinName()}
|
||||||
|
renderItem={({item}) => <SkinComponent skin={item} state='liste'/>} />
|
||||||
|
</View>
|
||||||
|
<BotBar
|
||||||
|
nav={navigation}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SkinList
|
@ -1,145 +1,39 @@
|
|||||||
import { StatusBar } from 'expo-status-bar'
|
import { StatusBar } from 'expo-status-bar'
|
||||||
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
|
import { StyleSheet, View} from 'react-native'
|
||||||
import React, { Children } from 'react';
|
import React from 'react';
|
||||||
import { SkinComponent } from '../components/skinAvatar';
|
import stylesScreen from './style/screens.style'
|
||||||
import { User } from '../core/user';
|
|
||||||
import { Skin } from '../core/skin';
|
import { Skin } from '../core/skin';
|
||||||
import { TopBar } from '../components/TopBar';
|
import { TopBar } from '../components/TopBar';
|
||||||
import { BotBar } from '../components/BotBar';
|
import { BotBar } from '../components/BotBar';
|
||||||
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
|
import { SkinComponent } from '../components/Skin';
|
||||||
|
import { ScreenIndicator } from '../components/ScreenIndicator';
|
||||||
|
|
||||||
|
import tabSkinApp from '../constSkin';
|
||||||
const avatar = require('../../assets/Icons/BobClassic.png');
|
|
||||||
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
|
|
||||||
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
|
|
||||||
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png');
|
|
||||||
const message = require('../../assets/Icons/UnSelected/Chat.png');
|
|
||||||
const store = require('../../assets/Icons/Selected/SStore.png');
|
|
||||||
|
|
||||||
function Store(props: { navigation: any; }) {
|
function Store(props: { navigation: any; }) {
|
||||||
const { navigation } = props
|
const { navigation } = props
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={stylesScreen.container}>
|
||||||
<TopBar
|
<TopBar
|
||||||
skin={skinTest}
|
skin={tabSkinApp[0]}
|
||||||
styleAvatar={styles.avatar}
|
nav={navigation}
|
||||||
title="BOB PARTY"
|
|
||||||
rightIcon={engrenage}
|
|
||||||
styleIcon={styles.engrenage}
|
|
||||||
nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
|
|
||||||
/>
|
/>
|
||||||
<View style={styles.body}>
|
<View style={stylesScreen.bodyStart}>
|
||||||
<Text style={styles.text}>couille</Text>
|
<ScreenIndicator title='Store'/>
|
||||||
|
<FlatList
|
||||||
|
data={tabSkinApp}
|
||||||
|
numColumns={2}
|
||||||
|
columnWrapperStyle={{ flex: 1, justifyContent: "space-around"}}
|
||||||
|
keyExtractor={item =>item.getSkinName()}
|
||||||
|
renderItem={({item}) => <SkinComponent skin={item} state='shop'/>} />
|
||||||
</View>
|
</View>
|
||||||
<BotBar
|
<BotBar
|
||||||
messages={message}
|
|
||||||
games={gamepad}
|
|
||||||
shop={store}
|
|
||||||
style={styles.iconFooter}
|
|
||||||
styleStore={styles.iconStore}
|
|
||||||
nav={navigation}
|
nav={navigation}
|
||||||
styleBar={styles.footer}
|
state='Store'
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Button(props: { onPress: any; title?: any | undefined; }) {
|
|
||||||
const { onPress, title = 'Save' } = props;
|
|
||||||
return (
|
|
||||||
<Pressable style={styles.button} onPress={onPress}>
|
|
||||||
<Text style={styles.text}>{title}</Text>
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
body: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
width: '70%',
|
|
||||||
},
|
|
||||||
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: "#45444E",
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
alignItems: "center",
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '30%',
|
|
||||||
width: '100%',
|
|
||||||
marginTop: '10%',
|
|
||||||
paddingVertical: 12,
|
|
||||||
paddingHorizontal: 32,
|
|
||||||
borderRadius: 10,
|
|
||||||
elevation: 3,
|
|
||||||
backgroundColor: '#0085FF',
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
fontSize: 16,
|
|
||||||
lineHeight: 21,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
flex : 0.15,
|
|
||||||
width: '100%',
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
titre: {
|
|
||||||
flex: 0.7,
|
|
||||||
flexDirection: 'column',
|
|
||||||
textAlign: 'center',
|
|
||||||
fontSize: 30,
|
|
||||||
fontFamily: 'Helvetica',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
letterSpacing: 0.25,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
engrenage: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
avatar: {
|
|
||||||
borderRadius: 50,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
footer: {
|
|
||||||
flex: 0.15,
|
|
||||||
flexDirection: 'row',
|
|
||||||
backgroundColor: '#2D2C33',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-evenly',
|
|
||||||
},
|
|
||||||
iconFooter: {
|
|
||||||
marginBottom: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
width: 65,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
iconStore: {
|
|
||||||
marginBottom: 25,
|
|
||||||
marginTop: 10,
|
|
||||||
marginLeft: 7,
|
|
||||||
marginRight: 8,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Store
|
export default Store
|
@ -0,0 +1,43 @@
|
|||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
const coinSkinGap = 10;
|
||||||
|
const infoGap = 20;
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
coinSkinView: {
|
||||||
|
flexDirection:'row',
|
||||||
|
},
|
||||||
|
coinView: {
|
||||||
|
width: '50%',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
skinView: {
|
||||||
|
width: '50%',
|
||||||
|
},
|
||||||
|
coin: {
|
||||||
|
width: 75,
|
||||||
|
height: 75,
|
||||||
|
marginVertical: (coinSkinGap/2),
|
||||||
|
},
|
||||||
|
coinText: {
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
marginVertical: (coinSkinGap/2),
|
||||||
|
},
|
||||||
|
infoView: {
|
||||||
|
marginLeft: '5%',
|
||||||
|
marginTop: '5%',
|
||||||
|
},
|
||||||
|
infoText: {
|
||||||
|
fontSize: 16,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
color: 'white',
|
||||||
|
marginVertical: (infoGap/2),
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,22 @@
|
|||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
export default StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: '#45444E',
|
||||||
|
flexDirection: "column",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
bodyStart: {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: 'column',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
bodyCenter: {
|
||||||
|
flex: 1,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,12 @@
|
|||||||
|
import { GameSolo } from "./core/gameSolo";
|
||||||
|
|
||||||
|
let myMap = new Map<number, number>([
|
||||||
|
[50, 3],
|
||||||
|
[75, 4],
|
||||||
|
[100, 5],
|
||||||
|
[150, 6]
|
||||||
|
]);
|
||||||
|
|
||||||
|
let game=new GameSolo("bo jeu", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "super jeu", myMap);
|
||||||
|
|
||||||
|
export default game;
|