public void SetSettings(int s, int i, int r, int x, int y) { CellJson setIn = new CellJson { _state = s, _id = i, _randomNum = r, _x = x, _y = y }; settings = setIn; SetState(setIn._state); }
public void placeCells(bool flg) { foreach (Transform child in cellGroup) { int _id = int.Parse(child.name.Substring(nameButtons.Length)); var(i, j) = field.findCoordsById(_id); CellJson settings = new CellJson { _state = field.array[i, j].getState(), _id = field.array[i, j].getId(), _randomNum = field.array[i, j].getRandomNum(), _x = field.array[i, j].getCoords().i, _y = field.array[i, j].getCoords().j }; child.GetComponent <CellScr>().SetSettings(settings); //if (child.GetComponent<CellScr>().settings._randomNum == field.array[i, j].getRandomNum()) //{ // continue; //} //child.GetComponent<CellScr>().settings.randomNum = field.array[i, j].getRandomNum(); //child.GetComponent<CellScr>().SetState(field.array[i, j].getState()); } }
public void AjouterEnvoisUnObjet(ListeParametresEnvoyes envois, XHtmlPage page, int niveau) { ListeParametresEnvoyes paramsValeurs = new ListeParametresEnvoyes(); ListeParametresEnvoyes paramsGrille = new ListeParametresEnvoyes(); paramsValeurs.Ajouter("idObjet", HtmlGlobal.CalculerId(this.Id, page.Id, niveau), this.Page.Html.CalculerIdPage(page.Id)); // presentation if (Tag != null) this.Tag.GenererHtml(paramsValeurs, this.Page.Html, 0, false); GridJson gj = new GridJson(); gj.nbCellules = this.Cellules.Count(); gj.vertical = this.Orientation == 1; gj.modePourcent = true; gj.tailleX = (int)this.Tag.OriginalWidth; gj.tailleY = (int)this.Tag.OriginalHeight; foreach (XHtmlCelluleGrille cell in this.Cellules) { CellJson gc = new CellJson(); gj.cellules.Add(gc); gc.avecResize = cell.AvecResize; // if (cell.Presentation.idFond.HasValue) // gc.fond = page.Html.App.GenererUneValeurDeCouleur(cell.Presentation.idFond); gc.posX = (int)cell.Presentation.Left; gc.posY = (int)cell.Presentation.Top; gc.tailleX = (int)cell.Presentation.OriginalWidth; gc.tailleY = (int)cell.Presentation.OriginalHeight; } paramsGrille.Ajouter("paramsGrille", HtmlGlobal.ToJsonString(gj, this.Page.Html.JsonGrille, false)); envois.Ajouter("creerGrille", HtmlGlobal.ToJsonString(paramsGrille, this.Page.Html.JsonParamsEnvoyes, false), HtmlGlobal.CalculerId(this.Id, page.Id, niveau)); envois.Ajouter("propsObjet", HtmlGlobal.ToJsonString(paramsValeurs, this.Page.Html.JsonParamsEnvoyes, false)); string p; if (this.Tag.GridId != 0) { p = "{" + "\"idGrille\":\"" + HtmlGlobal.CalculerId(this.Tag.GridId, this.Page.Id, niveau) + "\"," + "\"iCellule\":" + this.Tag.CellIndex + "}"; } else { p = "{" + "\"idGrille\":\"" + "0" + "\"," + "\"iCellule\":" + 0 + "}"; } envois.Ajouter("ajouterGrille", p); }
public void SetSettings(CellJson setIn) { settings = setIn; SetState(setIn._state); }