database classes
This commit is contained in:
parent
eb59940db2
commit
d6af38c644
8
Assets/Scripts/DatabaseClasses.meta
Normal file
8
Assets/Scripts/DatabaseClasses.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d72bb021c4624be8926ddb7e8e95ec3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
31
Assets/Scripts/DatabaseClasses/Player.cs
Normal file
31
Assets/Scripts/DatabaseClasses/Player.cs
Normal 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;
|
||||
}
|
||||
}
|
11
Assets/Scripts/DatabaseClasses/Player.cs.meta
Normal file
11
Assets/Scripts/DatabaseClasses/Player.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35e3951b470804ec7a58bb36aa6ca57b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Scripts/DatabaseClasses/Prompt.cs
Normal file
9
Assets/Scripts/DatabaseClasses/Prompt.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Prompt
|
||||
{
|
||||
public string id;
|
||||
public string text;
|
||||
}
|
11
Assets/Scripts/DatabaseClasses/Prompt.cs.meta
Normal file
11
Assets/Scripts/DatabaseClasses/Prompt.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a411cfa7a83945fe91266ec0690a09d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
10
Assets/Scripts/DatabaseClasses/Proposition.cs
Normal file
10
Assets/Scripts/DatabaseClasses/Proposition.cs
Normal 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;
|
||||
}
|
11
Assets/Scripts/DatabaseClasses/Proposition.cs.meta
Normal file
11
Assets/Scripts/DatabaseClasses/Proposition.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b40d0d645f6d44cd3a7d806d2e4c32bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
11
Assets/Scripts/DatabaseClasses/Question.cs
Normal file
11
Assets/Scripts/DatabaseClasses/Question.cs
Normal 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;
|
||||
}
|
11
Assets/Scripts/DatabaseClasses/Question.cs.meta
Normal file
11
Assets/Scripts/DatabaseClasses/Question.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a69ca9367b9f4b36abb81a861a996a4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
10
Assets/Scripts/DatabaseClasses/Room.cs
Normal file
10
Assets/Scripts/DatabaseClasses/Room.cs
Normal 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;
|
||||
}
|
11
Assets/Scripts/DatabaseClasses/Room.cs.meta
Normal file
11
Assets/Scripts/DatabaseClasses/Room.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d279c923334964e1b95d498ebfe08299
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
19
Assets/Scripts/RoomManager.cs
Normal file
19
Assets/Scripts/RoomManager.cs
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/RoomManager.cs.meta
Normal file
11
Assets/Scripts/RoomManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de098f8fd5f884a1aa55db7874246b92
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user