diff --git a/bob_party/src/screens/services/conversationService/ILoaderConversation.ts b/bob_party/src/screens/services/conversationService/ILoaderConversation.ts index fa03e90..4435be0 100644 --- a/bob_party/src/screens/services/conversationService/ILoaderConversation.ts +++ b/bob_party/src/screens/services/conversationService/ILoaderConversation.ts @@ -7,19 +7,19 @@ export default interface ILoaderConversation{ * loadAllConversation methode that load every Conversation in the data management system * return an array of Conversation */ - loadAllConversation(): Conversation[]; + loadAllConversation(): Promise; /** * loadByID methode that load an array of Conversation from the data management system by its id * id the id we want to search * return a Conversation if found, if not null */ - loadByID(id:string): Conversation | null; + loadByID(id:string): Promise; /** * loadByUser methode that load an array of Conversation from the data management system using a user * u the user we want the conversations of * return an array of Conversation */ - loadByUser(u:User): Conversation[]; + loadByUser(u:User): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/conversationService/ISaverConversation.ts b/bob_party/src/screens/services/conversationService/ISaverConversation.ts index d24a7f9..eaaae36 100644 --- a/bob_party/src/screens/services/conversationService/ISaverConversation.ts +++ b/bob_party/src/screens/services/conversationService/ISaverConversation.ts @@ -7,17 +7,17 @@ export default interface ISaverConversation{ * c the Conversation we want to save */ - saveConversation(c:Conversation): void; + saveConversation(c:Conversation): Promise; /** * deleteConversation methode that delete a Conversation in the data management system * c the Conversation we want to delete */ - deleteConversation(c:Conversation):void; + deleteConversation(c:Conversation): Promise; /** * updateConversation methode that update a Conversation in the data management system * c the Conversation we want to update */ - updateConversation(c:Conversation): void; + updateConversation(c:Conversation): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/matchServices/ILoaderMatch.ts b/bob_party/src/screens/services/matchServices/ILoaderMatch.ts index 7ea53f6..c020b21 100644 --- a/bob_party/src/screens/services/matchServices/ILoaderMatch.ts +++ b/bob_party/src/screens/services/matchServices/ILoaderMatch.ts @@ -6,12 +6,12 @@ export default interface ILoaderMatch{ * loadAllMatch methode that load every Match from the data management system * return an array of Match */ - loadAllMatch(): Match[]; + loadAllMatch(): Promise; /** * loadByID methode that load a match from the data management system by its id * id the id we want to search * return a Match if found, if not null */ - loadByID(id:string): Match | null; + loadByID(id:string): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/matchServices/ISaverMatch.ts b/bob_party/src/screens/services/matchServices/ISaverMatch.ts index 9c88319..7fbd664 100644 --- a/bob_party/src/screens/services/matchServices/ISaverMatch.ts +++ b/bob_party/src/screens/services/matchServices/ISaverMatch.ts @@ -7,17 +7,17 @@ export default interface ISaverMatch{ * m the Match we want to save */ - saveMatch(m:Match): void; + saveMatch(m:Match): Promise; /** * deleteMatch methode that delete a Match in the data management system * m the Match we want to delete */ - deleteMatch(m:Match):void; + deleteMatch(m:Match): Promise; /** * updateMatch methode that update a Match in the data management system * m the Match we want to update */ - updateMatch(m:Match): void; + updateMatch(m:Match): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/messageService/IMessageLoader.ts b/bob_party/src/screens/services/messageService/IMessageLoader.ts index eb7ed67..cb27871 100644 --- a/bob_party/src/screens/services/messageService/IMessageLoader.ts +++ b/bob_party/src/screens/services/messageService/IMessageLoader.ts @@ -7,19 +7,19 @@ export default interface ILoaderMessage{ * loadAllMessage methode that load every Message from the data management system * return an array of Message */ - loadAllMessage(): Message[]; + loadAllMessage(): Promise; /** * loadByID methode that load a Message from the data management system by its id * id the id we want to search * return a Message if found, if not null */ - loadByID(id:string): Message | null; + loadByID(id:string): Promise; /** * loadByUser methode that load an array of Message from the data management system using a Conversation * c the Conversation we want the Messages of * return an array of Message */ - loadByConversation(c:Conversation): Message[]; + loadByConversation(c:Conversation): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/messageService/IMessageSaver.ts b/bob_party/src/screens/services/messageService/IMessageSaver.ts index a83ae9e..3e328ee 100644 --- a/bob_party/src/screens/services/messageService/IMessageSaver.ts +++ b/bob_party/src/screens/services/messageService/IMessageSaver.ts @@ -7,6 +7,6 @@ export default interface ISaverMessage{ * m the Message we want to save */ - saveMessage(m:Message): void; + saveMessage(m:Message): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/userServices/ILoaderUser.ts b/bob_party/src/screens/services/userServices/ILoaderUser.ts index cb7829c..0ffb1b9 100644 --- a/bob_party/src/screens/services/userServices/ILoaderUser.ts +++ b/bob_party/src/screens/services/userServices/ILoaderUser.ts @@ -8,21 +8,21 @@ export default interface ILoaderUser{ * loadAllUser methode that load every user from the data management system * return an array of User */ - loadAllUser(): User[]; + loadAllUser(): Promise; /** * loadByID methode that load a user from the data management system by his id * id the id we want to search * return a User if found, if not null */ - loadByID(id:string): User | null; + loadByID(id:string): Promise; /** * loadByUsername methode that load a user from the data management system by his username * username the username we want to search * return a User if found, if not null */ - loadByUsername(username:string): User | null; + loadByUsername(username:string): Promise; /** * loadByUsernamePassword methode that load a user from the data management system by his username and his password @@ -30,17 +30,17 @@ export default interface ILoaderUser{ * password the password we want to search * return a User if found, if not null */ - loadByUsernamePassword(username:string, password:string): User | null; + loadByUsernamePassword(username:string, password:string): Promise; /** * loadUserByMatch methode that load every user in a game * return an array of User */ - loadUserByMatch(m:Match): User[]; + loadUserByMatch(m:Match): Promise; /** * laodUserByConversation methode that load every user in a Conversation * return an array of User */ - laodUserByConversation(c:Conversation): User[]; + loadUserByConversation(c:Conversation): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/userServices/ISaverUser.ts b/bob_party/src/screens/services/userServices/ISaverUser.ts index 871c0b3..9fbd862 100644 --- a/bob_party/src/screens/services/userServices/ISaverUser.ts +++ b/bob_party/src/screens/services/userServices/ISaverUser.ts @@ -7,17 +7,17 @@ export default interface ISaverUser{ * u the user we want to save */ - saveUser(u:User): void; + saveUser(u:User): Promise; /** * deleteUser methode that delete a User in the data management system * u the user we want to delete */ - deleteUser(u:User):void; + deleteUser(u:User):Promise; /** * updateUser methode that update a User in the data management system * u the user we want to update */ - updateUser(u:User): void; + updateUser(u:User): Promise; } \ No newline at end of file diff --git a/bob_party/src/screens/services/userServices/fakeSaverUser.ts b/bob_party/src/screens/services/userServices/fakeSaverUser.ts index d19e8e4..09ff653 100644 --- a/bob_party/src/screens/services/userServices/fakeSaverUser.ts +++ b/bob_party/src/screens/services/userServices/fakeSaverUser.ts @@ -4,13 +4,13 @@ import ISaverUser from "./ISaverUser"; export default class FakeSaverUser implements ISaverUser{ - saveUser(u: User): void { + async saveUser(u: User): Promise { return; } - deleteUser(u: User): void { + async deleteUser(u: User): Promise { return; } - updateUser(u: User): void { + async updateUser(u: User): Promise { return; } } \ No newline at end of file diff --git a/bob_party/src/screens/services/userServices/loaderUserApi.ts b/bob_party/src/screens/services/userServices/loaderUserApi.ts index c65f90d..e2fbe06 100644 --- a/bob_party/src/screens/services/userServices/loaderUserApi.ts +++ b/bob_party/src/screens/services/userServices/loaderUserApi.ts @@ -5,22 +5,22 @@ import ILoaderUser from "./ILoaderUser"; export default class LoaderUserApi implements ILoaderUser{ - loadAllUser(): User[] { + async loadAllUser(): Promise { throw new Error("Method not implemented."); } - loadByID(id: string): User | null { + async loadByID(id: string): Promise { throw new Error("Method not implemented."); } - loadByUsername(username: string): User | null { + async loadByUsername(username: string): Promise { throw new Error("Method not implemented."); } - loadByUsernamePassword(username: string, password: string): User | null { + async loadByUsernamePassword(username: string, password: string): Promise { throw new Error("Method not implemented."); } - loadUserByMatch(m: Match): User[] { + async loadUserByMatch(m: Match): Promise { throw new Error("Method not implemented."); } - laodUserByConversation(c: Conversation): User[] { + async loadUserByConversation(c: Conversation): Promise { throw new Error("Method not implemented."); } diff --git a/bob_party/src/screens/services/userServices/saverUserApi.ts b/bob_party/src/screens/services/userServices/saverUserApi.ts index 318e7fb..6883e4e 100644 --- a/bob_party/src/screens/services/userServices/saverUserApi.ts +++ b/bob_party/src/screens/services/userServices/saverUserApi.ts @@ -4,13 +4,13 @@ import ISaverUser from "./ISaverUser"; export default class SaverUserApi implements ISaverUser{ - saveUser(u: User): void { + async saveUser(u: User): Promise { throw new Error("Method not implemented."); } - deleteUser(u: User): void { + async deleteUser(u: User): Promise { throw new Error("Method not implemented."); } - updateUser(u: User): void { + async updateUser(u: User): Promise { throw new Error("Method not implemented."); } diff --git a/bob_party/src/screens/services/userServices/stub.ts b/bob_party/src/screens/services/userServices/stub.ts index 7e37f45..1e2d32e 100644 --- a/bob_party/src/screens/services/userServices/stub.ts +++ b/bob_party/src/screens/services/userServices/stub.ts @@ -13,10 +13,10 @@ export default class StubUser implements ILoaderUser{ new User("17", "Fefe63", "jesuishm", "ouioui", "homme", new Date(2022,12,12), 12222, 123324, 12, new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0), [new Skin("S0001", "Bob",require('bob_party/assets/BobsSkins/BobClassic.png'), 0)]), ]; - loadAllUser(): User[] { + async loadAllUser(): Promise { return this.tabUS; } - loadByID(id: string): User | null { + async loadByID(id: string): Promise { for(let u of this.tabUS){ if (u.getId()==id){ return u; @@ -24,7 +24,7 @@ export default class StubUser implements ILoaderUser{ } return null; } - loadByUsername(username: string): User | null { + async loadByUsername(username: string): Promise { for(let u of this.tabUS){ if (u.getUsername()==username){ return u; @@ -32,7 +32,7 @@ export default class StubUser implements ILoaderUser{ } return null; } - loadByUsernamePassword(username: string, password: string): User | null { + async loadByUsernamePassword(username: string, password: string): Promise { for(let u of this.tabUS){ if (u.getUsername()==username && u.getPassword()==password){ return u; @@ -41,14 +41,14 @@ export default class StubUser implements ILoaderUser{ return null; } - loadUserByMatch(m: Match): User[] { + async loadUserByMatch(m: Match): Promise { let tabUser:User[]=[]; m.getTabUsers().forEach(u => { tabUser.push(u); }); return tabUser; } - laodUserByConversation(c: Conversation): User[] { + async loadUserByConversation(c: Conversation): Promise { let tabUser:User[]=[]; c.getTabUser().forEach(u => { tabUser.push(u);