From 4e40489454fac2505ed8e36984cc961a90653f78 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Sun, 16 Oct 2022 12:03:38 +0200 Subject: [PATCH] ADD: ajout du fichier constSkin --- bob_party/src/const.ts | 14 -------------- bob_party/src/constSkin.ts | 14 ++++++++++++++ bob_party/src/core/gameSolo.ts | 7 ++++++- bob_party/src/core/skin.test.ts | 4 ++-- bob_party/src/screens/GameChoice.tsx | 10 +++++++--- bob_party/src/screens/Home.tsx | 7 +++++-- 6 files changed, 34 insertions(+), 22 deletions(-) delete mode 100644 bob_party/src/const.ts create mode 100644 bob_party/src/constSkin.ts diff --git a/bob_party/src/const.ts b/bob_party/src/const.ts deleted file mode 100644 index 41bf8dc..0000000 --- a/bob_party/src/const.ts +++ /dev/null @@ -1,14 +0,0 @@ -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/constSkin.ts b/bob_party/src/constSkin.ts new file mode 100644 index 0000000..1adf678 --- /dev/null +++ b/bob_party/src/constSkin.ts @@ -0,0 +1,14 @@ +import { Skin } from "./core/skin"; + +let tabSkinApp:Skin[]=[ + new Skin("S0001", "Bob Classsique",require('bob_party/assets/BobsSkins/BobClassic.png')), + new Skin("S0002", "Bob Blue",require('bob_party/assets/BobsSkins/BobBlue.png')), + new Skin("S0003", "Bob BW",require('bob_party/assets/BobsSkins/BobBW.png')), + new Skin("S0004", "Bob Green",require('bob_party/assets/BobsSkins/BobGreen.png')), + new Skin("S0005", "Bob Pink Turquoise",require('bob_party/assets/BobsSkins/BobPinkTurquoise.png')), + new Skin("S0006", "Bob Red",require('bob_party/assets/BobsSkins/BobRed.png')), + new Skin("S0007", "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 8a0c549..9b1b59d 100644 --- a/bob_party/src/core/gameSolo.ts +++ b/bob_party/src/core/gameSolo.ts @@ -1,5 +1,10 @@ +import { ImageSourcePropType } from 'react-native'; import { Game } from './game' export class GameSolo extends Game{ - readonly [index:number]:number; + readonly [Index:number]:number; + + constructor(name:string, imageSource:ImageSourcePropType, gameSource:string, [index:number]:number){ + super(name, imageSource, gameSource); + } } \ No newline at end of file diff --git a/bob_party/src/core/skin.test.ts b/bob_party/src/core/skin.test.ts index 1f6b0ca..9a68313 100644 --- a/bob_party/src/core/skin.test.ts +++ b/bob_party/src/core/skin.test.ts @@ -1,5 +1,5 @@ import { Skin } from './Skin'; - +/* let classique = new Skin('Classique', 'wouhou'); test('skin Name : Classique', () => { @@ -22,4 +22,4 @@ describe('Set tests', () => { it('should return The wouhou', () => { expect(classique.setSkinSource('The wouhou')).toBe('The wouhou'); }) -}) \ No newline at end of file +})*/ \ No newline at end of file diff --git a/bob_party/src/screens/GameChoice.tsx b/bob_party/src/screens/GameChoice.tsx index 77ae793..fee1a49 100644 --- a/bob_party/src/screens/GameChoice.tsx +++ b/bob_party/src/screens/GameChoice.tsx @@ -6,18 +6,22 @@ import { Skin } from '../core/skin'; import { TopBar } from '../components/TopBar'; import { BotBar } from '../components/BotBar'; import { ElementAffichage } from '../components/Element'; +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 avatar = require('../../assets/Icons/BobClassic.png'); -const skinTest= new Skin("S0001", "Bob",require('../../assets/Icons/BobClassic.png')); + +const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, 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 ( diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index 895174a..37f5199 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -8,11 +8,14 @@ import { TopBar } from '../components/TopBar'; import { BotBar } from '../components/BotBar'; import { Conversation } from '../core/conversation'; import { ButtonGameTypeChoice } from '../components/ButtonGameTypeChoice'; -import tabSkinApp from '../const'; +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 tabConv:Conversation[]=[]; const UserActu=new User("14", "leBg", "ouioui", "grand", new Date(2022,12,12), 12222, 123324, tabSkinApp[0], tabSkinApp, tabConv);