diff --git a/bob_party/src/components/Element.tsx b/bob_party/src/components/Element.tsx index 7b30415..106614f 100644 --- a/bob_party/src/components/Element.tsx +++ b/bob_party/src/components/Element.tsx @@ -3,7 +3,7 @@ import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, T import React from "react" import { Skin } from "../core/skin" import { trace } from "console" -import { Game } from "../core/Game" +import { Game } from "../core/game" export const ElementAffichage : FC<{element: any, styleImage: ImageStyle, styleTitle : TextStyle,nav: any}> = diff --git a/bob_party/src/components/skinAvatar.tsx b/bob_party/src/components/skinAvatar.tsx index 7d8d759..c738592 100644 --- a/bob_party/src/components/skinAvatar.tsx +++ b/bob_party/src/components/skinAvatar.tsx @@ -2,6 +2,7 @@ import { FC} from "react" import {Image, ImageStyle, View } from "react-native" import { Skin } from "../core/Skin" import React from "react" +import { Asset } from "expo-asset" export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => { diff --git a/bob_party/src/const.ts b/bob_party/src/const.ts new file mode 100644 index 0000000..41bf8dc --- /dev/null +++ b/bob_party/src/const.ts @@ -0,0 +1,14 @@ +import { Skin } from "./core/skin"; + +let tabSkinApp:Skin[]=[ + new Skin("0001", "Bob Classsique",require('bob_party/assets/BobsSkins/BobClassic.png')), + new Skin("0002", "Bob Blue",require('bob_party/assets/BobsSkins/BobBlue.png')), + new Skin("0003", "Bob BW",require('bob_party/assets/BobsSkins/BobBW.png')), + new Skin("0004", "Bob Green",require('bob_party/assets/BobsSkins/BobGreen.png')), + new Skin("0005", "Bob Pink Turquoise",require('bob_party/assets/BobsSkins/BobPinkTurquoise.png')), + new Skin("0006", "Bob Red",require('bob_party/assets/BobsSkins/BobRed.png')), + new Skin("0007", "Bob Cute",require('bob_party/assets/BobsSkins/BobYellowGreenBlueHeart.png')), +] + + +export default tabSkinApp; \ No newline at end of file diff --git a/bob_party/src/core/gameSolo.ts b/bob_party/src/core/gameSolo.ts index 2e7050d..8a0c549 100644 --- a/bob_party/src/core/gameSolo.ts +++ b/bob_party/src/core/gameSolo.ts @@ -1,5 +1,5 @@ import { Game } from './game' export class GameSolo extends Game{ - private + readonly [index:number]:number; } \ No newline at end of file diff --git a/bob_party/src/core/skin.ts b/bob_party/src/core/skin.ts index 9cd6915..cd6ad3e 100644 --- a/bob_party/src/core/skin.ts +++ b/bob_party/src/core/skin.ts @@ -1,10 +1,12 @@ import { ImageSourcePropType } from "react-native"; export class Skin{ + readonly Id: string; private Name: string; private Source: ImageSourcePropType; - constructor(name: string, source:ImageSourcePropType){ + constructor(id:string, name: string, source:ImageSourcePropType){ + this.Id=id; this.Name=name; this.Source=source; } @@ -24,4 +26,8 @@ export class Skin{ getSkinName(){ return this.Name; } + + getSkinId(){ + return this.Id; + } } \ No newline at end of file diff --git a/bob_party/src/screens/GameChoice.tsx b/bob_party/src/screens/GameChoice.tsx index c932240..2e7f018 100644 --- a/bob_party/src/screens/GameChoice.tsx +++ b/bob_party/src/screens/GameChoice.tsx @@ -1,7 +1,7 @@ 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 { Game } from '../core/game'; import { Skin } from '../core/skin'; import { TopBar } from '../components/TopBar'; import { BotBar } from '../components/BotBar'; @@ -11,7 +11,7 @@ import { GoBackBar } from '../components/GoBackBar'; const msc = require('../../assets/Icons/FondGris.png'); const avatar = require('../../assets/Icons/BobClassic.png'); -const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png')); +const skinTest= new Skin("0001", "Bob",require('../../assets/Icons/BobClassic.png')); const jeuTest= new Game("SNAKE", require('../../assets/Icons/UnSelected/Gamepad.png'),"ouin"); const cross = require('../../assets/Icons/UnSelected/Cross.png'); const gamepad = require('../../assets/Icons/Selected/SGamepad.png'); diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index 3ef6bb4..5bcc952 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -8,28 +8,20 @@ import { TopBar } from '../components/TopBar'; import { BotBar } from '../components/BotBar'; import { Conversation } from '../core/conversation'; import { ButtonGameChoice } from '../components/ButtonGameChoice'; +import tabSkinApp from '../const'; -let test:ImageSourcePropType; -const test2:string="('../../assets/Icons/BobClassic.png')"; - -test = test2 as ImageSourcePropType; - -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); +const avatar = require('../../assets/Icons/BobClassic.png'); let tabConv:Conversation[]=[]; -const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, skinTest, tabSkin, tabConv); +const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, tabSkinApp[0], tabSkinApp, tabConv); function Home(props: { navigation: any; }) { const { navigation } = props return (