diff --git a/bob_party/src/core/Game.ts b/bob_party/src/core/Game.ts new file mode 100644 index 0000000..8104ba9 --- /dev/null +++ b/bob_party/src/core/Game.ts @@ -0,0 +1,35 @@ +export interface Game{ + private Name:String; + private ImageSource:String; + private GameSource:String; + + constructor(name:String, imageSource:String, gameSource:String){ + this.Name=name; + this.ImageSource=imageSource + this.GameSource=gameSource; + } + + getName(){ + return this.Name; + } + + setName(name:String){ + this.Name=name; + } + + getImageSource(imageSource:String){ + return this.ImageSource; + } + + setImageSource(imageSource:String){ + this.ImageSource=imageSource; + } + + getGameSource(){ + return this.GameSource; + } + + setGameSource(gameSource:String){ + this.GameSource=gameSource; + } +} \ No newline at end of file diff --git a/bob_party/src/core/conversation.ts b/bob_party/src/core/conversation.ts index 5101847..f6c35c1 100644 --- a/bob_party/src/core/conversation.ts +++ b/bob_party/src/core/conversation.ts @@ -2,7 +2,7 @@ import { Message } from "./message" import { User } from "./user"; -export class conversation{ +export class Conversation{ private TabUser?: User[]; private TabMessage?: Message[]; @@ -19,6 +19,13 @@ export class conversation{ return this.TabUser; } + ajouterUser(us:User){ + this.TabUser?.push(us); + } + + ajouterMessage(mess:Message){ + this.TabMessage?.push(mess); + } } diff --git a/bob_party/src/core/user.ts b/bob_party/src/core/user.ts index 9c645de..0bb386f 100644 --- a/bob_party/src/core/user.ts +++ b/bob_party/src/core/user.ts @@ -1,18 +1,20 @@ import { Skin } from './Skin' +import { Conversation } from './conversation'; export class User{ private Id: string; private Username: string; private Nationality: string; private Sexe: string; - private DateOfBirth: string; + private DateOfBirth: Date; private CurrentCoins: number; private TotalCoins: number; private CurrentSkin: Skin; private TabSkin: Skin[]; + private TabConv: Conversation[]; - constructor(id: string, username: string, nationality: string, sexe: string, dateOfBirth: string, currentCoins: number, totalCoins: number, - currentSkin: Skin, tabSkin: Skin[] ){ + constructor(id: string, username: string, nationality: string, sexe: string, dateOfBirth: Date, currentCoins: number, totalCoins: number, + currentSkin: Skin, tabSkin: Skin[], tabConv: Conversation[] ){ this.Id=id; this.Username=username; this.Nationality=nationality; @@ -22,6 +24,7 @@ export class User{ this.TotalCoins=totalCoins; this.CurrentSkin=currentSkin; this.TabSkin=[...tabSkin]; + this.TabConv=[...tabConv]; } getUsername(){ @@ -60,7 +63,7 @@ export class User{ return this.DateOfBirth; } - setDateOfBirth(dateOfBirth: string){ + setDateOfBirth(dateOfBirth: Date){ this.DateOfBirth=dateOfBirth; } @@ -95,4 +98,12 @@ export class User{ setTabSkin(tabSkin: Skin[]){ this.TabSkin=[...tabSkin]; } + + getTabConv(){ + return this.TabConv; + } + + setTabConv(tabConv: Conversation[]){ + this.TabConv=[...tabConv]; + } } \ No newline at end of file diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index 9dd1349..59ede39 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -6,6 +6,7 @@ import { User } from '../core/user'; import { Skin } from '../core/skin'; import { TopBar } from '../components/TopBar'; import { BotBar } from '../components/BotBar'; +import { Conversation } from '../core/conversation'; @@ -15,7 +16,8 @@ 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 UserActu=new User("14", "leBg", "ouioui", "grand", "la", 12222, 123324, skinTest, tabSkin); +let tabConv:Conversation[]=[]; +const UserActu=new User("14", "leBg", "ouioui", "grand", "la", 12222, 123324, skinTest, tabSkin, 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');