Esempio n. 1
0
    protected void OnAdRewarded(object _sender, Reward _args)
    {
        Debug.Log("AdRewarded!!!");

        if (_args != null)
        {
            Debug.Log("AdRewardedRewardType[" + _args.Type + "]");
            Debug.Log("AdRewardedRewardAmount[" + _args.Amount.ToString() + "]");
        }
        json = File.ReadAllText(Application.persistentDataPath + "/data.json");//読み取ってるよ
        json = encryption.DecryptString(json);
        savedata sv = new savedata();

        JsonUtility.FromJsonOverwrite(json, sv);//読み取ったのを変換してるよ
        sv._yobi1 = sv._yobi1 + 250;
        json      = JsonUtility.ToJson(sv);
        json      = encryption.EncryptString(json);
        File.WriteAllText(Application.persistentDataPath + "/data.json", json);//結局これでよかった
        mypoint mp = scriptbox.GetComponent <mypoint>();

        mp.Load();
        // DailyBonusData.Instance.addSpecialBonusNotice("AD_REWARD_1");

        IsActive = true;
    }
    public void Saving()
    {
        // we can save everything in the savedata class.
        savedata data = new savedata();

        // save the character points
        data.char_points = game_manager.gameManager.get_points();
        // save the weapon the player is currently using
        data.current_weapon_id = game_manager.gameManager.currentWeaponID;

        // add all weapons from the weapon shoplist
        for (int i = 0; i < shop_system.shop.weapon_list.Count; i++)
        {
            data.shoplist.Add(shop_system.shop.weapon_list[i]);
        }

        BinaryFormatter bf           = new BinaryFormatter();
        FileStream      stream_items = new FileStream("./shop_info.save", FileMode.Create);

        // serialize the data
        bf.Serialize(stream_items, data);
        stream_items.Close();

        print("Saved shop state!");
        SceneManager.LoadScene(2);
    }
Esempio n. 3
0
    void Start()
    {
        //jsonの初回ロード
        json = File.ReadAllText(Application.persistentDataPath + "/data.json");//読み取ってるよ
        savedata sv = new savedata();

        json = encryption.DecryptString(json);
        JsonUtility.FromJsonOverwrite(json, sv);//読み取ったのを変換してるよ
        jiki = sv._jiki;
        //jiki = 10;

        //ここから
        if (jikimat = Resources.Load <Material>("Materials/no" + jiki))
        {
            firsttriangle.GetComponent <SpriteRenderer>().material = jikimat;
            Debug.Log(jiki + "じゃん");
            matFound = true;
        }
        else
        {
            jikispr = Resources.Load <Sprite>("Materials/no" + jiki);
            firsttriangle.GetComponent <SpriteRenderer>().sprite = jikispr;
            Debug.Log("ないじゃn");
        }
        //ここまで

        //自機色決定
        //        mycolor = new Color(0, 1, 1, 1);
        //
        //自機色決定
        //        mycolor = new Color(0, 1, 1, 1);
        //        aroundcolor = new Color(1, 0, 1, 1);

        firsttriangle.GetComponent <SpriteRenderer>().color = mycolor;



        firsttriangle.GetComponent <SpriteRenderer>().color = mycolor;


        //周りの色決定
        patternset pm     = BigTriangleNOW.GetComponent <patternset>();
        relay      pmm    = BigBigTriangleNOW.GetComponent <relay>();
        relay1     pmmm   = BigBigBigTriangleNOW.GetComponent <relay1>();
        relay1     pup    = Triup_third.GetComponent <relay1>();
        relay1     pleft  = Trileft_third.GetComponent <relay1>();
        relay1     pright = Triright_third.GetComponent <relay1>();

        pm.aroundcolorchange();
        pmm.aroundcolorchange();
        pmmm.aroundcolorchange();
        pup.aroundcolorchange();
        pleft.aroundcolorchange();
        pright.aroundcolorchange();

        SE_container se = scriptbox.GetComponent <SE_container>();//スコアを取得

        se.SEswitch(sv._sound);
        se.BGMswitch(sv._BGM);
    }
    void Awake()
    {
        curId = 0;
        scale = 5F;

        ColorClass.Initialize();

        instatiatedObj = new List <BaseObj> ();

        m_savedata = record.load();
        if (m_savedata != null)
        {
            if (m_savedata.m_general != null)
            {
                if (m_savedata.m_general.curId <= 0)
                {
                    m_savedata.m_general.curId = 0;
                }
                if (m_savedata.m_general.scale <= 0)
                {
                    m_savedata.m_general.scale = scale;
                }
            }
            else
            {
                curId = m_savedata.m_general.curId;
                scale = m_savedata.m_general.scale;
            }
        }

        instance = this;
        instanceThisGameObject = this.gameObject;
    }
Esempio n. 5
0
    public void Load()
    {
        //	//Debug.Log (" ++++++++++++ Load Data +++++++++++++++");
        data = RMS.Load();
        if (data != null)
        {
            MC_Gold       = data.MC_Gold;
            MC_Ruby       = data.MC_Ruby;
            MC_PlaneID    = data.MC_PlaneID;
            MC_BotLeftID  = data.MC_BotLeftID;
            MC_BotRightID = data.MC_BotRightID;

            List_Planes.Clear();
            foreach (int i in data.MC_Planes)
            {
                List_Planes.Add(i);
            }

            List_Bots.Clear();
            foreach (int i in data.MC_Bots)
            {
                List_Bots.Add(i);
            }
        }
    }
Esempio n. 6
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //清空存放数据列表
            SDL317.Clear();

            //市辖部分的行号
            int SXrow = fc.Sheet_Find_Value(obj_sheet, 0, "1");
            //县级部分的行号
            int XJrow = fc.Sheet_Find_Value(obj_sheet, 0, "2");
            //差为电压等级数
            int DYnum = XJrow - SXrow;

            //存在电压等级
            if (DYnum != 0)
            {
                //市辖供电区加上县级供电区的四个分区,共有5个分区,加上县级合计有6个分区
                for (int row = SXrow; row < obj_sheet.RowCount - DYnum; row++)
                {
                    savedata tempdata = new savedata();
                    //县级合计部分跳过
                    if (row == XJrow)
                    {
                        row = row + DYnum;
                    }
                    string no = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 0);
                    string dy = obj_sheet.Cells[row, 2].Value.ToString();
                    tempdata.no   = no;
                    tempdata.dy   = dy;
                    tempdata.data = obj_sheet.GetValue(row, 6);
                    SDL317.Add(tempdata);
                }
            }
        }
    public void Load()
    {
        if (File.Exists("./shop_info.save"))
        {
            print("Loading shop state!");
            BinaryFormatter bf           = new BinaryFormatter();
            FileStream      stream_items = new FileStream("./shop_info.save", FileMode.Open);

            savedata data = (savedata)bf.Deserialize(stream_items);
            game_manager.gameManager.set_char_points(data.char_points);
            game_manager.gameManager.currentWeaponID = data.current_weapon_id;

            stream_items.Close();


            //After loading the shop state into shoplist, we will for loop through shoplist and populate the shop accordingly
            for (int i = 0; i < data.shoplist.Count; i++)
            {
                // update the shop state with what we saved.
                shop_system.shop.weapon_list[i] = data.shoplist[i];

                //update item holder
                shop_system.shop.update_sprite(shop_system.shop.weapon_list[i].weapon_id);

                // update the buttons
                shop_system.shop.update_buy_button(game_manager.gameManager.currentWeaponID);
            }
        }
        else
        {
            print("No previously saved avatar shop state exists!");
        }
    }
Esempio n. 8
0
    public void SaveData()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create("save.RB");

        savedata savedata = new savedata();

        //finds all the players
        for (int i = 0; i < battlehandler.BSM.players.Count; i++)
        {
            savedata.playerdat.Add(new playerdata());
        }

        //saving money, shop items and enemyGeneration
        savedata.money      = ModeHandler.money;
        savedata.shop_phase = ModeHandler.modehandler.ShopMenu.levelReqSelection;
        foreach (FoodStuffs food in ModeHandler.modehandler.ShopMenu.foodlist)
        {
            savedata.shopFood.Add(food.foodName);
        }
        foreach (Move move in ModeHandler.modehandler.ShopMenu.moveList)
        {
            savedata.shopMoves.Add(move);
        }
        foreach (Character chara in ModeHandler.modehandler.ShopMenu.characterList)
        {
            savedata.shopCharacters.Add(chara);
        }
        //savedata.shopFood = ModeHandler.modehandler.ShopMenu.foodlist;
        //savedata.shopMoves = ModeHandler.modehandler.ShopMenu.moveList;
        //savedata.shopCharacters = ModeHandler.modehandler.ShopMenu.characterList;

        savedata.eGenPhase = battlehandler.BSM.eGen.currentPhase;

        //save all the exp, levels and stuff
        for (int i = 0; i < battlehandler.BSM.players.Count; i++)
        {
            PlayerCharacter player = (PlayerCharacter)battlehandler.BSM.players[i];
            savedata.playerdat[i].attack           = player.attack;
            savedata.playerdat[i].exptoNextLevel   = player.exptoNextLevel;
            savedata.playerdat[i].exp              = player.exp;
            savedata.playerdat[i].level            = player.level;
            savedata.playerdat[i].maxSpecialPoints = player.maxSpecialPoints;
            savedata.playerdat[i].maxHealth        = player.maxHealth;
            savedata.playerdat[i].defence          = player.defence;
            savedata.playerdat[i].intelligence     = player.intelligence;

            savedata.playerdat[i].foodItem = (player.foodItem != null) ? player.foodItem.name : null;
            savedata.playerdat[i].foodTurn = player.foodTurn;
            savedata.playerdat[i].name     = player.name;
            savedata.playerdat[i].id       = i;
            savedata.playerdat[i].moves    = player.moves;
        }

        bf.Serialize(file, savedata);
        file.Close();
        print("saved");
        Destroy(this.gameObject);
    }
Esempio n. 9
0
    public SerializedSaveData ConvertFromOldData(savedata oldData)
    {
        SerializedSaveData newData = new SerializedSaveData();

        newData.objectList     = oldData.list1;
        newData.terrianHeights = oldData.heights;
        return(newData);
    }
Esempio n. 10
0
    public void Load()
    {
        if (File.Exists(Application.dataPath + "/saves/SaveData.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.dataPath + "/saves/SaveData.dat", FileMode.Open);
            data = (savedata)bf.Deserialize(file);

            CopyLoadData();
            file.Close();
        }
    }
Esempio n. 11
0
 public void Load()
 {
     if (File.Exists(Application.dataPath + "/saves.SaveData.dat"))
     {
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open(Application.dataPath + "/saves/SaveData.dat", FileMode.Open);
         data = (savedata)bf.Deserialize(file);
         CopyLoadData();
         file.Close();
         GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Master>().desktops = profiles;
         GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Master>().fileBook = bookmarks;
     }
 }
Esempio n. 12
0
    public static void Save(savedata data)
    {
        if (!Directory.Exists(Application.dataPath + "/SaveLoad"))
        {
            Directory.CreateDirectory(Application.dataPath + "/SaveLoad");
        }

        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.dataPath + "/SaveLoad/RMS.dat");

        bf.Serialize(file, data);
        file.Close();
    }
Esempio n. 13
0
    public void Debugkane()
    {
        savedata sv = new savedata();

        json = File.ReadAllText(Application.persistentDataPath + "/data.json"); //読み取ってるよ
        json = encryption.DecryptString(json);
        JsonUtility.FromJsonOverwrite(json, sv);                                //読み取ったのを変換してるよ

        sv._yobi1 += 100000;

        json = JsonUtility.ToJson(sv);
        json = encryption.EncryptString(json);
        File.WriteAllText(Application.persistentDataPath + "/data.json", json);//結局これでよかった
    }
Esempio n. 14
0
    public void Save()
    {
        savedata saveData = new savedata();

        saveData.sceneName = currentScene;
        saveData.playerHP  = playerHP;

        FileStream fileStream = File.Create(Application.persistentDataPath + "/save.dat");

        Debug.Log("저장 파일 생성");
        BinaryFormatter binaryFormatter = new BinaryFormatter();

        binaryFormatter.Serialize(fileStream, saveData);
        fileStream.Close();
    }
Esempio n. 15
0
 public void Load()
 {
     if (File.Exists(Application.persistentDataPath + "/save.dat") == true)
     {
         FileStream fileStream = File.Open(Application.persistentDataPath + "/save.dat", FileMode.Open);
         if (fileStream != null && fileStream.Length > 0)
         {
             BinaryFormatter binaryFormatter = new BinaryFormatter();
             savedata        savedata        = (savedata)binaryFormatter.Deserialize(fileStream);
             playerHP = savedata.playerHP;
             UiManager.instance.PlayerHP();
             currentScene = savedata.sceneName;
             fileStream.Close();
         }
     }
 }
Esempio n. 16
0
    // Update is called once per frame
    public void Debug()
    {
        savedata sv = new savedata();

        json = File.ReadAllText(Application.persistentDataPath + "/data.json"); //読み取ってるよ
        json = encryption.DecryptString(json);
        JsonUtility.FromJsonOverwrite(json, sv);                                //読み取ったのを変換してるよ

        for (int i = 0; i < 31; i++)
        {
            sv._jikiflag[i] = true;
            //getflag = 19;
        }
        json = JsonUtility.ToJson(sv);
        json = encryption.EncryptString(json);
        File.WriteAllText(Application.persistentDataPath + "/data.json", json);//結局これでよかった
    }
Esempio n. 17
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //清空存放数据列表
            SDL318_19.Clear();

            //市辖部分的行号
            int SXrow = fc.Sheet_Find_Value(obj_sheet, 0, "市辖供电区");
            //县级部分的行号
            int XJrow = fc.Sheet_Find_Value(obj_sheet, 0, "县级供电区");

            //为-1时表示没找到,也就是电压等级为0个
            if (SXrow != -1)
            {
                //市辖供电区中第一行第二列的“合计”部分合并的行数就是电压等级数
                //int dysum = obj_sheet.Cells[SXrow, 1].RowSpan;
                int dysum = 1;
                //存储市辖部分除合计以外的数据
                for (int row = SXrow + dysum; row < XJrow; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ       = "市辖供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    for (int col = 2; col < 6; col++)
                    {
                        tempdata.data[col - 2] = obj_sheet.GetValue(row, col);
                    }

                    SDL318_19.Add(tempdata);
                }
                //存储县级部分除合计以外的数据
                for (int row = XJrow + dysum; row < obj_sheet.RowCount; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ       = "县级供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    for (int col = 2; col < 6; col++)
                    {
                        tempdata.data[col - 2] = obj_sheet.GetValue(row, col);
                    }

                    SDL318_19.Add(tempdata);
                }
            }
        }
Esempio n. 18
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            SDL3_7_3.Clear();
            //用于更新时保存用户数据
            for (int row = 5; row < obj_sheet.Rows.Count; row++)
            {
                if (obj_sheet.Cells[row, 1].Value.ToString() != "合计")
                {
                    savedata tempsd = new savedata(2, 3);
                    tempsd.DQ       = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 0);
                    tempsd.AreaName = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    if (obj_sheet.Cells[row, 4].Value != null)
                    {
                        tempsd.data[0, 0] = obj_sheet.GetValue(row, 4);
                    }
                    if (obj_sheet.Cells[row, 7].Value != null)
                    {
                        tempsd.data[0, 1] = obj_sheet.GetValue(row, 7);
                    }
                    if (obj_sheet.Cells[row, 14].Value != null)
                    {
                        tempsd.data[0, 2] = obj_sheet.GetValue(row, 14);
                    }

                    if (obj_sheet.Cells[row + 1, 4].Value != null)
                    {
                        tempsd.data[1, 0] = obj_sheet.GetValue(row + 1, 4);
                    }
                    if (obj_sheet.Cells[row + 1, 7].Value != null)
                    {
                        tempsd.data[1, 1] = obj_sheet.GetValue(row + 1, 7);
                    }
                    if (obj_sheet.Cells[row + 1, 14].Value != null)
                    {
                        tempsd.data[1, 2] = obj_sheet.GetValue(row + 1, 14);
                    }
                    SDL3_7_3.Add(tempsd);
                }
                //行号加一
                row++;
            }
        }
Esempio n. 19
0
    public static savedata load()
    {
        savedata data_tmp = null;

        if (PlayerPrefs.HasKey("savedata"))
        {
            data_tmp = prefload <savedata>("savedata");
        }
        else
        {
            data_tmp           = new savedata();
            data_tmp.m_general = new GeneralData();
            data_tmp.m_obj     = new ObjectsData[0];

            /*
             * data_tmp.m_stockitem = new stockitem();
             * data_tmp.m_bookkeeping = new bookkeepingdata();
             * data_tmp.m_gamesetting = new gamesetting();
             * data_tmp.m_lithograph = new lithhographdata(); */
        }
        return(data_tmp);
    }
Esempio n. 20
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            SDL33_1.Clear();
            //返回县级供电区开始行号
            int xjrow = fc.Sheet_Find_Value(obj_sheet, 0, "县级供电区");

            for (int row = 3; row < obj_sheet.RowCount; row++)
            {
                if (row != xjrow)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ       = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 0);
                    tempdata.areaname = obj_sheet.Cells[row, 1].Value.ToString();
                    tempdata.data[0]  = obj_sheet.GetValue(row, 2);
                    tempdata.data[1]  = obj_sheet.GetValue(row, 3);
                    tempdata.data[2]  = obj_sheet.GetValue(row, 4);
                    tempdata.data[3]  = obj_sheet.GetValue(row, 5);
                    tempdata.data[4]  = obj_sheet.GetValue(row, 6);
                    SDL33_1.Add(tempdata);
                }
            }
        }
Esempio n. 21
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //清空存放数据列表
            SDL317_17.Clear();

            //市辖部分的行号
            int SXrow = fc.Sheet_Find_Value(obj_sheet, 0, "市辖供电区");
            //县级部分的行号
            int XJrow = fc.Sheet_Find_Value(obj_sheet, 0, "县级供电区");

            //为-1时表示没找到,也就是电压等级为0个
            if (SXrow != -1)
            {
                //市辖供电区中第一行第二列的“合计”部分合并的行数就是电压等级数
                int dysum = obj_sheet.Cells[SXrow, 1].RowSpan;

                //存储市辖部分除合计以外的所有行的第7列数据
                for (int row = SXrow + dysum; row < XJrow; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ       = "市辖供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    tempdata.dy       = obj_sheet.Cells[row, 2].Value.ToString();
                    tempdata.data     = obj_sheet.GetValue(row, 6);
                    SDL317_17.Add(tempdata);
                }
                //存储县级部分除合计以外的所有行的第7列数据
                for (int row = XJrow + dysum; row < obj_sheet.RowCount; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ       = "县级供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    tempdata.dy       = obj_sheet.Cells[row, 2].Value.ToString();
                    tempdata.data     = obj_sheet.GetValue(row, 6);
                    SDL317_17.Add(tempdata);
                }
            }
        }
Esempio n. 22
0
    // Use this for initialization
    void Start()
    {
        //jsonの初回ロード
        json = File.ReadAllText(Application.persistentDataPath + "/data.json");//読み取ってるよ
        json = encryption.DecryptString(json);
        savedata sv = new savedata();

        JsonUtility.FromJsonOverwrite(json, sv);//読み取ったのを変換してるよ
        //sv._jiki = 16;
        switch (sv._jiki)
        {
        case 16:
            Debug.Log("いいぞー");
            Mcamera.GetComponent <SepiaTone>().enabled = true;
            break;

        case 17:
            parti0.SetActive(true);
            parti1.SetActive(true);
            parti2.SetActive(true);
            parti3.SetActive(true);
            parti4.SetActive(true);
            break;

        case 18:
            Mcamera.GetComponent <MotionBlur>().enabled = true;
            break;

        case 19:
            Mcamera.GetComponent <Twirl>().enabled = true;
            break;

        case 32:
            Rainbow.SetActive(true);
            break;
        }
    }
Esempio n. 23
0
    public void Load(string name)
    {
        if (File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "saves" + Path.DirectorySeparatorChar + name + ".dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/saves/" + name + ".dat", FileMode.Open);
            try
            {
                try
                {
                    data = (SerializedSaveData)bf.Deserialize(file);
                }
                catch (InvalidCastException ex)
                {
                    savedata oldData = null;

                    // If this is an old save file, convert it.
                    oldData   = (savedata)bf.Deserialize(file);
                    data      = ConvertFromOldData(oldData);
                    isOldFile = true;
                }
            }
            catch (SerializationException exs)
            {
                List <string> s = new List <string>();
                s.Add("Back to Main Menu");
                WindowUI wui = new WindowUI(WindowImage.ERROR, WindowType.OK, s, "Unable to Load World", "It looks like the world could not be loaded. This could be due to a corruption or old version.", false, 22, ExitDefault.NONE);
                wui.SetBackgroundActive(true);
                wui.Display();
            }

            CopyLoadData();

            file.Close();
        }//
    }
Esempio n. 24
0
    public void LoadData()
    {
        BinaryFormatter bf        = new BinaryFormatter();
        FileStream      file      = File.Open("save.RB", FileMode.Open);
        savedata        loadedsav = (savedata)bf.Deserialize(file);

        print(loadedsav.eGenPhase);
        ModeHandler.money = loadedsav.money;

        List <playerdata> players = loadedsav.playerdat;

        ModeHandler.modehandler.ShopMenu.AddStuffFromList(loadedsav.shopFood, loadedsav.shopMoves, loadedsav.shopCharacters);
        battlehandler.BSM.players.Clear();
        foreach (playerdata player in players)
        {
            //TODO: CALL FUNCTION OF BATTLE HANDLER AND HAVE IT INSTATNTIATE OBJECT ACCORDING TO STATS OF "PLAYER"
            battlehandler.BSM.addCharacters(player);
        }

        //foreach (string food in loadedsav.shopFood) { }

        battlehandler.BSM.eGen.currentPhase = loadedsav.eGenPhase;
        Destroy(this.gameObject);
    }
Esempio n. 25
0
 public static void save(savedata data)
 {
     // 保存用クラスにデータを格納.
     prefsave("savedata", data);
     PlayerPrefs.Save();
 }
Esempio n. 26
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //清空存放数据列表
            SDL318_19.Clear();

            //市辖部分的行号
            int SXrow = fc.Sheet_Find_Value(obj_sheet, 0, "市辖供电区");
            //县级部分的行号
            int XJrow = fc.Sheet_Find_Value(obj_sheet, 0, "县级供电区");
            //为-1时表示没找到,也就是电压等级为0个
            if (SXrow != -1)
            {
                //市辖供电区中第一行第二列的“合计”部分合并的行数就是电压等级数
                //int dysum = obj_sheet.Cells[SXrow, 1].RowSpan;
                int dysum = 1;
                //存储市辖部分除合计以外的数据
                for (int row = SXrow + dysum; row < XJrow; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ = "市辖供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    for (int col = 2; col < 6; col++)
                    {
                        tempdata.data[col-2] = obj_sheet.GetValue(row, col);
                    }

                    SDL318_19.Add(tempdata);
                }
                //存储县级部分除合计以外的数据
                for (int row = XJrow + dysum; row < obj_sheet.RowCount; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ = "县级供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    for (int col = 2; col < 6; col++)
                    {
                        tempdata.data[col - 2] = obj_sheet.GetValue(row, col);
                    }

                    SDL318_19.Add(tempdata);
                }
            }
        }
Esempio n. 27
0
 public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
 {
     SDL33_1.Clear();
     //返回县级供电区开始行号
     int xjrow = fc.Sheet_Find_Value(obj_sheet, 0, "县级供电区");
     for (int row = 3; row < obj_sheet.RowCount; row++)
     {
         if (row != xjrow)
         {
             savedata tempdata = new savedata();
             tempdata.DQ = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 0);
             tempdata.areaname = obj_sheet.Cells[row, 1].Value.ToString();
             tempdata.data[0] = obj_sheet.GetValue(row, 2);
             tempdata.data[1] = obj_sheet.GetValue(row, 3);
             tempdata.data[2] = obj_sheet.GetValue(row, 4);
             tempdata.data[3] = obj_sheet.GetValue(row, 5);
             tempdata.data[4] = obj_sheet.GetValue(row, 6);
             SDL33_1.Add(tempdata);
        }
     }
 }
Esempio n. 28
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //清空存放数据列表
            SDL317.Clear();

            //市辖部分的行号
            int SXrow = fc.Sheet_Find_Value(obj_sheet, 0, "1");
            //县级部分的行号
            int XJrow = fc.Sheet_Find_Value(obj_sheet, 0, "2");
            //差为电压等级数
            int DYnum = XJrow - SXrow;
            //存在电压等级
            if (DYnum!=0)
            {
                //市辖供电区加上县级供电区的四个分区,共有5个分区,加上县级合计有6个分区
                for (int row = SXrow; row < obj_sheet.RowCount-DYnum; row++)
                {
                    savedata tempdata = new savedata();
                    //县级合计部分跳过
                    if (row==XJrow)
                    {
                        row = row + DYnum ;
                    }
                    string no = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 0);
                    string dy = obj_sheet.Cells[row, 2].Value.ToString();
                    tempdata.no = no;
                    tempdata.dy = dy;
                    tempdata.data = obj_sheet.GetValue(row, 6);
                    SDL317.Add(tempdata);
                }

            }
        }
Esempio n. 29
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            SDL3_7_3.Clear();
            //用于更新时保存用户数据
            for (int row = 5; row < obj_sheet.Rows.Count; row++)
            {
                if (obj_sheet.Cells[row, 1].Value.ToString() != "合计")
                {
                    savedata tempsd = new savedata(2, 3);
                    tempsd.DQ = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 0);
                    tempsd.AreaName = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    if (obj_sheet.Cells[row, 4].Value != null)
                    {
                        tempsd.data[0, 0] = obj_sheet.GetValue(row, 4);
                    }
                    if (obj_sheet.Cells[row, 7].Value != null)
                    {
                        tempsd.data[0, 1] = obj_sheet.GetValue(row, 7);
                    }
                    if (obj_sheet.Cells[row, 14].Value != null)
                    {
                        tempsd.data[0, 2] = obj_sheet.GetValue(row, 14);
                    }

                    if (obj_sheet.Cells[row + 1, 4].Value != null)
                    {
                        tempsd.data[1, 0] = obj_sheet.GetValue(row + 1, 4);
                    }
                    if (obj_sheet.Cells[row + 1, 7].Value != null)
                    {
                        tempsd.data[1, 1] = obj_sheet.GetValue(row + 1, 7);
                    }
                    if (obj_sheet.Cells[row + 1, 14].Value != null)
                    {
                        tempsd.data[1, 2] = obj_sheet.GetValue(row + 1, 14);
                    }
                    SDL3_7_3.Add(tempsd);

                }
                //行号加一
                row++;
            }
        }
Esempio n. 30
0
        public void SaveData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            //清空存放数据列表
            SDL320_21.Clear();

            //市辖部分的行号
            int SXrow = fc.Sheet_Find_Value(obj_sheet, 0, "市辖供电区");
            //县级部分的行号
            int XJrow = fc.Sheet_Find_Value(obj_sheet, 0, "县级供电区");
            //为-1时表示没找到,也就是电压等级为0个
            if (SXrow != -1)
            {
                //市辖供电区中第一行第二列的“合计”部分合并的行数就是电压等级数
                int dysum = obj_sheet.Cells[SXrow, 1].RowSpan;

                //存储市辖部分除合计以外的所有行的第4列数据
                for (int row = SXrow + dysum; row < XJrow; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ = "市辖供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    tempdata.dy = obj_sheet.Cells[row, 2].Value.ToString();
                    tempdata.data = obj_sheet.GetValue(row, 3);
                    SDL320_21.Add(tempdata);
                }
                //存储县级部分除合计以外的所有行的第4列数据
                for (int row = XJrow + dysum; row < obj_sheet.RowCount; row++)
                {
                    savedata tempdata = new savedata();
                    tempdata.DQ = "县级供电区";
                    tempdata.areaname = fc.Sheet_find_Rownotemptycell(obj_sheet, row, 1);
                    tempdata.dy = obj_sheet.Cells[row, 2].Value.ToString();
                    tempdata.data = obj_sheet.GetValue(row, 3);
                    SDL320_21.Add(tempdata);
                }
            }
        }
Esempio n. 31
0
 // Use this for initialization
 void Start()
 {
     data = new savedata();
 }