var {shortenedCollectionName}Entry = API.getItem("{collectionName}", {collectionKey}).document(); var {shortenedCollectionName}Data = {shortenedCollectionName}Entry.getData();
var {shortenedCollectionName}Entry = API.getItem("{collectionName}", {collectionKey}).document(); var {shortenedCollectionName}Data = {shortenedCollectionName}Entry.getData();
Set a Response
use sendMessageTo{Receiver}({specificToTheMethod}, {messageType}, {messageData}) when you MODIFY data
Information you want to send to the Client.Client.
send teamUid and/or studentUid when you send message to teacher (so that the teacher can filter the message)
use Spark.setScriptData('{ObjectName}ObjectName}', {Object}Object}) when you GET data
Client (VS15.9.8: C#)
Standard
Cases
Class PascalCase
Methods PascalCase
Private members _camelCase
Public members camelCase
Document
Formatting order (each of those section should be surrounded by region with sub-region if necessary)
Public membersPublic propertyConstructorsMethodsPrivate propertyPrivate Members
Whenever possible surround code with #region MyRegion {code} #endregion to make the .cs clearer
use Stubs when the interface only need partial information instead of loading all the data
if you want to do Lazy loading or Lazy Initialization make a Property (the reference is always private)
public : under public members
private : over private members
ex.: private Dictionary<string, TextMeshProUGUI> TeamEvalTexts { get { if (_teamEvalTexts == null) { _teamEvalTexts = new Dictionary<string, TextMeshProUGUI>(); _teamEvalTexts[Simulation.SIM_PERF_NAME] = simPerfNoteText; _teamEvalTexts[Simulation.LOGBOOK_NAME] = logbookNoteText; } return _teamEvalTexts; } } private Dictionary<string, TextMeshProUGUI> _teamEvalTexts;
Data
SetListeners in the data contructors
the data Update itself and fire a relevent Action
Filter the Response with teamUid and/or studentUid when the teacher receive the message
Client (Unity)
Boutons
ConfirmButton are always to the right
CancelButton are always to the left