database classes

This commit is contained in:
Morgan - 6 Freedom 2024-01-27 10:19:32 +01:00
parent eb59940db2
commit d6af38c644
13 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4d72bb021c4624be8926ddb7e8e95ec3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public class Player
{
public string name;
public string id;
/// <summary>
/// Will sanitize the text and set it for the player
/// </summary>
public void SetName(string _name)
{
name = SanitizeString(_name);
}
private string SanitizeString(string input)
{
// Utilisez une expression régulière pour supprimer tout ce qui n'est pas une lettre ou un chiffre
string sanitized = Regex.Replace(input, @"[^a-zA-Z0-9]", "");
// Limitez la longueur à 16 caractères maximum
if (sanitized.Length > 16)
{
sanitized = sanitized.Substring(0, 16);
}
return sanitized;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 35e3951b470804ec7a58bb36aa6ca57b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Prompt
{
public string id;
public string text;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a411cfa7a83945fe91266ec0690a09d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Proposition
{
public string photoUrl;
public Player owner;
public string[] voters;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b40d0d645f6d44cd3a7d806d2e4c32bd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Question
{
public string promptId;
public Proposition propositions;
public int creationDate;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a69ca9367b9f4b36abb81a861a996a4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
using System.Collections.Generic;
public class Room
{
public string code;
public List<Question> questions;
public List<Player> players;
public int currentQuestion;
public int creationDate;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d279c923334964e1b95d498ebfe08299
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RoomManager : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: de098f8fd5f884a1aa55db7874246b92
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: