Example #1
0
 public void Load()
 {
     ActiveDataSave = null;
     if (!Directory.Exists(SavesPathDirectory))
     {
         Directory.CreateDirectory(SavesPathDirectory);
     }
     if (File.Exists(DataSaveFilePath))
     {
         BinaryFormatter bf         = new BinaryFormatter();
         FileStream      fileStream = File.Open(DataSaveFilePath, FileMode.Open);
         try {
             ActiveDataSave = new DataSave((DataSave)bf.Deserialize(fileStream));
             fileStream.Close();
         }
         catch {
             fileStream.Close();
             File.Delete(DataSaveFilePath);
             ActiveDataSave = new DataSave();
         }
     }
     else
     {
         ActiveDataSave = new DataSave();
     }
     ClearEmptyLevels();
     dataSave = ActiveDataSave;
     if (true)
     {
     }
 }
Example #2
0
    IEnumerator PreloadAccountImages(string key)
    {
        Iloading search = new SearchAccount();

        Debug.Log("searching...");
        yield return(StartCoroutine(PreloadingManager.instance.LoadingProcess(key, search)));

        if (!search.isContainErrors())
        {
            Debug.Log("Starting load account data");

            Iloading type = new Download_FindAccount();

            yield return(StartCoroutine(PreloadingManager.instance.LoadingProcess(key, type)));

            DataSave.SavePostsInfo(type.GetPosts());

            yield return(new WaitForSeconds(1));

            GameControllerScr.loadGame = false;
            SceneManager.LoadScene("Game");
        }
        else
        {
            Debug.Log("Account not found");
        }
    }
Example #3
0
        public void RiskmanStart()
        {
            CacheTool.MatchAdd(MatchId);
            DataSave.UpdateMatchReplayStatus(MatchId, 6);
            DataSave.UpdateMatcScore(MatchId, "0:0");
            DataSave.DeleteAndBackupOdds(MatchId);

            Log.Info($"賽事編號:{MatchId} 開始傳送走地資料");
            Log.Info($"賽事編號:{MatchId} 開始傳送賠率資料");

            if (flag == 1)
            {
                for (int i = 0, j = 0; i <= RiskOddsDataList.Count; i++)
                {
                    PushProcessByOdds(i, j);
                    if (j == 0 || i == modIndex || (i - modIndex) % avgIndex == 0)
                    {
                        j = j + 1;
                    }
                    Thread.Sleep(avgTimeForOdds);
                }
            }
            else
            {
                for (int i = 0, j = 0; i <= Scout.Length; i++)
                {
                    PushProcessByScout(i, j);
                    if (j == 0 || i == modIndex || (i - modIndex) % avgIndex == 0)
                    {
                        j = j + 1;
                    }
                    Thread.Sleep(avgTimeForOdds);
                }
            }
        }
Example #4
0
 private void PushProcessByScout(int ssIndex, int ooIndex)
 {
     try
     {
         if (ssIndex + 1 > Scout.Length)
         {
             Log.Info($"賽事編號:{MatchId} 第{ssIndex + 1}次走地資料送完");
             Log.Info($"賽事編號:{MatchId},第{ooIndex + 1}次賠率資料送完");
             //賠率送完即結算
             DataSave.DoSettle(MatchId, 1); //全場
             DataSave.DoSettle(MatchId, 2); //半場
             CacheTool.MatchRemove(MatchId);
             return;
         }
         if (ooIndex == 0 || ssIndex == modIndex || (ssIndex - modIndex) % avgIndex == 0)
         {
             PushOddsToRiskMan(ooIndex);
         }
         PushScoutToMq(ssIndex);
     }
     catch (Exception ex)
     {
         Log.Info($"賽事編號:{MatchId},第{ssIndex + 1}次ssIndex失敗,失敗原因:{ex.Message},失敗原因:{ex.StackTrace}");
     }
 }
Example #5
0
        private List <ExecuteMatchListGet> RefreshList()
        {
            //var ThreadList = CacheTool.ThreadList;
            //List<ExecuteMatchListGet> eList = new List<ExecuteMatchListGet>();
            //foreach (var tid in ThreadList)
            //{
            //    var data = DataSave.ExecuteMatchListGet(tid.Key);
            //    if (data.Count > 0)
            //    {
            //        eList.Add(data[0]);
            //    }
            //}
            //return eList;

            var MatchList = CacheTool.MatchList;
            List <ExecuteMatchListGet> eList = new List <ExecuteMatchListGet>();

            foreach (var tid in MatchList)
            {
                var data = DataSave.ExecuteMatchListGet(tid);
                if (data.Count > 0)
                {
                    eList.Add(data[0]);
                }
            }
            return(eList);
        }
Example #6
0
        private List <long> InitMatchList()
        {
            //取有賠率與走地的賽事編號
            var matches  = new List <long>();
            var matchStr = CacheService.GetInitMatchList();

            if (!string.IsNullOrEmpty(matchStr))
            {
                matches = JsonConvert.DeserializeObject <List <long> >(matchStr);
            }
            else
            {
                var scoutMatchIds = DataSave.FetchLiveScout();
                var oddsMatchIds  = DataSave.FetchOdds();
                foreach (var matchId in oddsMatchIds)
                {
                    foreach (var scoutMatchId in scoutMatchIds)
                    {
                        if (matchId > 0 && matchId == scoutMatchId && !matches.Contains(matchId))
                        {
                            matches.Add(matchId);
                        }
                    }
                }
                CacheService.SetInitMatchList(matches, false);
            }
            return(matches);
        }
Example #7
0
        // GET: Home
        public ActionResult Index()
        {
            var matches = InitMatchList();

            ViewBag.MatchList = DataSave.MatchListEnableGet(matches);
            return(View());
        }
Example #8
0
        /// <summary>
        /// 保存英雄属性
        /// </summary>
        /// <returns></returns>
        private static string SaveHeroStatus()
        {
            Hero     hero = Hero.GetInstance();
            DataSave data = new DataSave
            {
                Properties = new HeroProperties()
                {
                    hp        = hero.properties.hp,
                    atk       = hero.properties.atk,
                    def       = hero.properties.def,
                    res       = hero.properties.res,
                    level     = hero.properties.level,
                    gold      = hero.properties.gold,
                    exp       = hero.properties.exp,
                    yellowKey = hero.properties.yellowKey,
                    blueKey   = hero.properties.blueKey,
                    redKey    = hero.properties.redKey,
                    x         = hero.properties.x,
                    y         = hero.properties.y
                },
                Map      = MapUtility.GetAllFloorType(),
                FloorNum = FloorFactory.GetInstance().GetFloorNum()
            };

            return(JsonConvert.SerializeObject(data));
        }
Example #9
0
    public static DataSave <T> FromJson <T, T1, T2>(string jsonOut)
    {
        //jsonOut.('[');
        // jsonOut.Remove(']');
        jsonOut.Replace("},", "}|");
        string[]     s    = jsonOut.Split('|');
        DataSave <T> game = new DataSave <T>();

        for (int i = 0; i < s.Length; i++)
        {
            T   sd    = JsonUtility.FromJson <T>(s[i]);
            var _temp = sd.GetType().GetField("NAME").GetValue(sd);
            if (_temp.ToString().Equals(typeof(T1).ToString()))
            {
                sd = (T)(object)JsonUtility.FromJson <T1>(s[i]);
            }
            else if (_temp.ToString().Equals(typeof(T2).ToString()))
            {
                sd = (T)(object)JsonUtility.FromJson <T2>(s[i]);
            }
            else
            {
            }
            game.results.Add(sd);
        }
        return(game);
    }
Example #10
0
 /// <summary>设置数据集值</summary>
 /// <param name="ds">数据集</param>
 /// <param name="colname">列名</param>
 /// <param name="isval">是否写入值</param>
 /// <param name="val">值</param>
 public static void SetDataSaveValue(ref DataSave ds, string colname, bool isval, string val)
 {
     if (isval)
     {
         ds.Operp(val, colname);
     }
 }
Example #11
0
        /// <summary>
        /// Riskman
        /// </summary>
        public void RiskmanStart()
        {
            CacheTool.MatchAdd(MatchId);
            DataSave.UpdateMatchReplayStatus(MatchId, 6);
            DataSave.UpdateMatcScore(MatchId, "0:0");
            DataSave.DeleteAndBackupOdds(MatchId);
            //DataSave.UpdateOddsStatus(MatchId, 4);


            if (Scout.Length > 0)
            {
                Log.Info($"賽事編號:{MatchId} 開始傳送走地資料");
                PushScoutToMq(0);
            }
            else
            {
                Log.Info($"賽事編號:{MatchId} 沒有走地資料");
            }

            if (RiskOddsDataList.Count > 0)
            {
                Log.Info($"賽事編號:{MatchId} 開始傳送賠率資料");
                PushOddsToRiskMan(0);
            }
            else
            {
                Log.Info($"賽事編號:{MatchId} 沒有賠率資料");
            }
        }
Example #12
0
    public bool LoadSaveOnStart; //Debug Variable used to disable save loading when the game starts. (And save... saving.)

    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("PlayerScript Running");

        if (System.IO.File.Exists(Application.persistentDataPath + "/PlayerData.save") & LoadSaveOnStart)
        {
            PlayerData data = DataSave.Load();
            values       = data.Values;
            stats        = data.Stats;
            statusTimers = data.StatusEffects;
            modifiers    = data.Modifiers;
            data         = null;
        }
        else
        {
            PlayerData data = new PlayerData("Player");
            values       = data.Values;
            stats        = data.Stats;
            statusTimers = data.StatusEffects;
            modifiers    = data.Modifiers;
            data         = null;
        }

        HUDManager.UpdateHud(values);
        Coroutine actionCoroutine = StartCoroutine("ActionCoroutine");
        Coroutine statusCoroutine = StartCoroutine("StatusCoroutine");
        Coroutine manaCoroutine   = StartCoroutine("ManaCoroutine");
    }
Example #13
0
    public void LoadGame()
    {
        // 1
        if (File.Exists(Application.persistentDataPath + "/gamesave.txt"))
        {
            // 2
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/gamesave.txt", FileMode.Open);
            DataSave        data = (DataSave)bf.Deserialize(file);
            file.Close();

            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().ennemieG         = data.ennemieG;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().competencies     = data.competencies;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().competenciesText = data.competenciesText;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().inventory        = data.inventory;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().inventoryTexte   = data.inventoryTexte;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().all_text         = data.all_text;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().posPlayer.x      = data.x;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().posPlayer.y      = data.y;
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameData>().posPlayer.z      = data.z;
            Debug.Log("Game load");
        }
        else
        {
            Debug.Log("No game saved!");
        }
    }
Example #14
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #15
0
        private void PushProcess(int oIndex, int sIndex)
        {
            try
            {
                if (oIndex + 1 > Odds.Length)
                {
                    Log.Info($"賽事編號:{MatchId} 第{sIndex + 1}次走地資料送完");
                    Log.Info($"賽事編號:{MatchId},第{oIndex + 1}次賠率資料送完");
                    DataSave.SwitchOddsActive(MatchId);
                    //賠率送完即結算
                    DataSave.DoSettle(MatchId, 1); //全場
                    DataSave.DoSettle(MatchId, 2); //半場
                    CacheTool.MatchRemove(MatchId);
                    return;
                }

                if (sIndex == 0 || oIndex == modIndex || (oIndex - modIndex) % avgIndex == 0)
                {
                    PushScoutToMq(sIndex);
                }

                PushOddstToSportServer(oIndex);
            }
            catch (Exception ex)
            {
                Log.Info($"賽事編號:{MatchId},第{oIndex + 1}次oIndex失敗,失敗原因:{ex.Message},失敗原因:{ex.StackTrace}");
            }
        }
Example #16
0
 private void LoadData()
 {
     if (File.Exists(savePath))
     {
         StreamReader streamReader = null;
         try
         {
             streamReader = new StreamReader(savePath);
             dataSave     = DataSave.SerializeData(streamReader.ReadToEnd());
         }
         catch (Exception e)
         {
             Debug.LogException(e);
         }
         finally
         {
             if (streamReader != null)
             {
                 streamReader.Close();
             }
         }
     }
     else
     {
         Debug.LogWarning("No save file could be found!");
     }
 }
Example #17
0
    public IEnumerator loadMap()
    {
        root _data = DataSave.GetData();

        numMap       = _data._Level;
        gameStrategy = _data._strategy;

        Debug.Log(_data.height + " - " + _data.width + " list " + _data.data.Count);
        field = new Field(_data.height, _data.width);
        field.initField(true);
        Debug.Log(_data.data.Count);
        for (int i = 0; i < _data.data.Count; i++)
        {
            var coords = field.findCoordsById(_data.data[i]._id);
            field.array[coords.i, coords.j].setId(_data.data[i]._id);
            field.array[coords.i, coords.j].setRandomNum(_data.data[i]._randomNum);
            field.array[coords.i, coords.j].setState(_data.data[i]._state);
        }

        placeCells();

        yield return(new WaitForEndOfFrame());

        cellState = _data._scellState;

        //grid.enabled = false;
        // SortHierarchy();
    }
Example #18
0
        private void PushOddstToSportServer(int index)
        {
            try
            {
                Odds[index].Status = 1;
                var ot = new OperationRequest
                {
                    OperationCode = (int)OperationCode.MainService,
                    ActionCode    = (int)MainServiceActionCode.BroadcastOdds,
                    Parameters    = new Dictionary <byte, object> {
                        { 1, Odds[index] }
                    }
                };
                var lodData = JsonConvert.SerializeObject(Odds[index]);
                Log.Info($"賽事編號:{MatchId},第{index + 1}次發送賠率資料:{lodData}");

                var pevMsgNr = (index == 0) ? 0 : Odds[index - 1].MsgNr;
                if (Odds[index].MsgNr > pevMsgNr || pevMsgNr == 0)
                {
                    DataSave.SwitchOddsActive(Odds[index].MatchId, /*Odds[index].OddsId,*/ Odds[index].MsgNr);
                    DataSave.UpdateMatchCurrentPeriodStart(Odds[index].MatchId);
                }
            }
            catch (Exception ex)
            {
                var lodData = JsonConvert.SerializeObject(Odds[index]);
                Log.Info($"賽事編號:{MatchId},第{index + 1}次失敗,失敗原因:{ex.Message},失敗原因:{ex.StackTrace}");
            }
        }
Example #19
0
File: Main.cs Project: wpmyj/csharp
        private void Form1_Load(object sender, EventArgs e)
        {
            Tools.SetDoubleBuf(dataGridView1, true);
            Tools.Grid_OutoSize(dataGridView1);
            this.webBrowser1.DocumentText = string.Empty;
            this.webBrowser1.Document.ExecCommand("EditMode", false, null);
            this.webBrowser1.Document.ExecCommand("LiveResize", false, null);
            webBrowser1.Url         = new Uri(Value.PathMail + Ini.Read("HtmlPath"));
            textBox1.Text           = Ini.Read("MailTitle");
            fileSystemWatcher1.Path = Value.PathMail;
            textBox2.Text           = Ini.Read("附件路径");
            if (Tools.GetFileSize(Value.PathWork + Ini.Read("MailPath")) > 10000)
            {
                MessageBox.Show("任务文件过大,避免卡机,建议启动后手动加载!", "提示");
            }
            else
            {
                DataSave.GetDataFromFile(Value.PathWork + Ini.Read("MailPath"), dataGridView1);
            }
            if (Ini.Read("自动登陆") == "是")
            {
                toolStripLabel2.Text = "正在登陆";
            }
            Ini.Write("RecordPath", "Record.DLL");
            ThreadSend TS = new ThreadSend(null, 0);//加载消息

            TS.OnReceivedData += new ThreadSend.ReceivedData(Thread_OnReceivedData);
            new Thread(new ThreadStart(TS.Func)).Start();
        }
Example #20
0
 public static bool LoadData(string Patch = null, bool UpdaeData = false)
 {
     Patch = Patch != null ? Patch + "\\" + Setting.NameFolderData : Setting.NameFolderData;
     if (!File.Exists((Patch != null) ? Patch + "\\" + Setting.NameJsonBd : Setting.NameJsonBd))
     {
         return(false);
     }
     Bd = JsonConvert.DeserializeObject <DataSave>(File.ReadAllText((Patch != null) ? Patch + "\\" + Setting.NameJsonBd : Setting.NameJsonBd));
     if (!UpdaeData)
     {
         foreach (var Masc in Bd.months)
         {
             foreach (var Var in Masc.vars)
             {
                 for (int i = 0; i < Var.varOtvet.otvet_C_Parts.Count; i++)
                 {
                     var Otv = Var.varOtvet.otvet_C_Parts[i];
                     // Логка измненя ссылок
                     //===========================
                     Var.varOtvet.otvet_C_Parts[i] = Otv;
                 }
             }
         }
     }
     return(true);
 }
Example #21
0
        public void BetRadarStart()
        {
            CacheTool.MatchAdd(MatchId);
            DataSave.UpdateMatchReplayStatus(MatchId, 6);
            DataSave.UpdateMatcScore(MatchId, "0:0");
            //DataSave.DeleteAndBackupOdds(MatchId);
            DataSave.UpdateOddsStatus(MatchId, 4);


            if (Scout.Length > 0)
            {
                Log.Info($"賽事編號:{MatchId} 開始傳送走地資料");
                PushScoutToMq(0);
            }
            else
            {
                Log.Info($"賽事編號:{MatchId} 沒有走地資料");
            }

            if (Odds.Length > 0)
            {
                Log.Info($"賽事編號:{MatchId} 開始傳送賠率資料");
                PushOddstToSportServer(0);
            }
            else
            {
                Log.Info($"賽事編號:{MatchId} 沒有賠率資料");
            }
        }
Example #22
0
 public static DataSave Instance()
 {
     if (!instance)
     {
         instance = new DataSave();
     }
     return(instance);
 }
Example #23
0
    private void Start()
    {
        ds          = FindObjectOfType <DataSave>();
        start_1_Btn = GameObject.Find("開始按鈕_1").GetComponent <Button>();
        Invoke("ShowTip", 4f);

        ClickBtn();
    }
Example #24
0
    public static void Save(Game_Data data)
    {
        BinaryFormatter bf     = new BinaryFormatter();
        FileStream      stream = new FileStream(Application.persistentDataPath + "/data.sav", FileMode.Create);
        DataSave        dt     = new DataSave(data);

        bf.Serialize(stream, dt);
        stream.Close();
    }
Example #25
0
    public void Save()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/Save.sav");

        DataSave data = CreateData();

        bf.Serialize(file, data);
        file.Close();
    }
Example #26
0
 private void ReFresh()
 {
     lst_Main.Items.Clear();
     foreach (Website website in websites.GetArray())
     {
         lst_Main.Items.Add(website.Name);
     }
     DataSave.WebsiteSave(websites, ProgramPath);
     lst_Main_SelectedIndexChanged(null, null);
 }
Example #27
0
    private void Start()
    {
        ds        = FindObjectOfType <DataSave>();
        filepath  = Application.persistentDataPath + "/" + "Save.txt";
        begin_btn = GameObject.Find("進入遊戲按鈕").GetComponent <Button>();

        Invoke("ActivateBtn", 4f);

        ClickBtn();
    }
Example #28
0
    public IEnumerator Loading(string key)
    {
        posts = new root_posts();

        //t_path = Application.persistentDataPath + "/images/thumbnails/";
        s_path    = Application.persistentDataPath + "/images/standart/";
        PostsPath = Application.persistentDataPath + "/posts.json";

        root_posts _posts = DataSave.GetpostsData();

        if (_posts != null)
        {
            //string[] tpath = Directory.GetFiles(t_path);
            string[] spath = Directory.GetFiles(s_path);

            DownloadManager.instance.CreateLoadingBar();

            for (int i = 0; i < _posts._p.Count; i++)
            {
                //byte[] t_imgBytes = File.ReadAllBytes(t_path + "t_" + i + ".png"); // File.ReadAllBytes(tpath[i]);
                byte[] s_imgBytes = File.ReadAllBytes(s_path + "s_" + i + ".png");

                // Texture2D t_tex = new Texture2D(2, 2);
                Texture2D s_tex = new Texture2D(2, 2);

                // t_tex.LoadImage(t_imgBytes);
                s_tex.LoadImage(s_imgBytes);

                PostInfo info = new PostInfo
                {
                    StandartTexture = s_tex, //((DownloadHandlerTexture)s_request.downloadHandler).texture,
                    //ThumbnailTexture = t_tex, //((DownloadHandlerTexture)t_request.downloadHandler).texture,
                    comments     = _posts._p[i].comments,
                    thumbnail    = _posts._p[i].thumbnail,
                    description  = _posts._p[i].description,
                    id           = _posts._p[i].id,
                    likes        = _posts._p[i].likes,
                    post_url     = _posts._p[i].post_url,
                    standard     = _posts._p[i].standard,
                    usernameFrom = _posts._p[i].usernameFrom,
                    postLink     = _posts._p[i].postLink
                };

                posts._p.Add(info);
                DownloadManager.ProgressHandler?.Invoke(i, _posts._p.Count);
                yield return(null);
            }
            DownloadManager.instance.DeleteLoadingBar();
        }
        else
        {
            posts.AccountKey = DownloadManager.notFoundError;
            yield break;
        }
    }
Example #29
0
 public void Load()
 {
     if (File.Exists(Application.persistentDataPath + "/Save.sav"))
     {
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open(Application.persistentDataPath + "/Save.sav", FileMode.Open);
         DataSave        data = (DataSave)bf.Deserialize(file);
         file.Close();
         LoadData(data);
     }
 }
Example #30
0
    public static void SaveGame()
    {
        BinaryFormatter bf     = new BinaryFormatter();
        FileStream      stream = new FileStream(Application.persistentDataPath + "save.sav", FileMode.Create);

        DataSave dataSave = new DataSave(GameManager.Instance);

        bf.Serialize(stream, dataSave);

        stream.Close();
    }
Example #31
0
    DataSave CreateData()
    {
        DataSave data = new DataSave();

        data.waterStock=lvlC.waterStock;
        data.foodStock=lvlC.foodStock;
        data.constructStock=lvlC.constructStock;
        data.chemStock=lvlC.chemStock;
        data.levelRecolt=lvlC.levelRecolt;
        data.levelStrong=lvlC.levelStrong;
        data.levelScout=lvlC.levelScout;
        data.levelSabot=lvlC.levelSabot;
        data.timer=lvlC._time;
        data.amelDisp=lvlC.amelDisp;

        GameObject[] brigObjects =GameObject.FindGameObjectsWithTag("Brigade");

        data.nbBrig=brigObjects.Length;
        data.brigadesType=new typeBrig[data.nbBrig];
        data.brigadesPos=new float[data.nbBrig,3];
        data.brigadesLife=new float[data.nbBrig];
        data.brigadesSpeed=new float[data.nbBrig];
        data.brigadesPoison=new float[data.nbBrig,2];

        int i=0;
        foreach (GameObject brigO in brigObjects)
        {
            BrigadeController brig=brigO.GetComponent<BrigadeController>();
            data.brigadesType[i]=brig.typeBrigade;
         	data.brigadesPos[i,0]=brig.transform.position.x;
            data.brigadesPos[i,1]=brig.transform.position.y;
            data.brigadesPos[i,2]=brig.transform.position.z;
         	data.brigadesLife[i]=brig.life;
         	data.brigadesSpeed[i]=brig.speed;
         	data.brigadesPoison[i,0]=brig.damagePoison;
            data.brigadesPoison[i,1]=brig.lenghtPoisonRemain;

         	i++;
        }

        return data;
    }
Example #32
0
    void LoadData(DataSave data)
    {
        lvlC.waterStock=data.waterStock;
        lvlC.foodStock=data.foodStock;
        lvlC.constructStock=data.constructStock;
        lvlC.chemStock=data.chemStock;
        lvlC.levelRecolt=data.levelRecolt;
        lvlC.levelStrong=data.levelStrong;
        lvlC.levelScout=data.levelScout;
        lvlC.levelSabot=data.levelSabot;
        lvlC.timeRemain=data.timer;
        lvlC.amelDisp=data.amelDisp;

        for (int i=0; i<data.nbBrig; i++)
        {
            Vector3 pos=new Vector3(data.brigadesPos[i,0],data.brigadesPos[i,1],data.brigadesPos[i,2]);
            BrigadeController brig=lvlC.AddBrigade(data.brigadesType[i], pos);
            brig.isSelected=false;
        }

        //penser à "isPoisonned"
    }