Пример #1
0
 void LoadShopInfo()
 {
     for (int i = 0; i < shopwList.Length; i++)
     {
         shopInfoesDic.Add(shopwList[i], (ExternalFileSystem.SingleTon().GetShopInfo(shopwList[i])));
     }
 }
Пример #2
0
 public static ExternalFileSystem SingleTon()
 {
     if (single_instance == null)
     {
         single_instance = new ExternalFileSystem();
     }
     return(single_instance);
 }
Пример #3
0
    public void SavePlayData(Message message)
    {
        Debug.Log("PlayInfoManager.SavePlayData : is called");
        Message         getPlayInfoList = new Message("GetPlayInfoList : ").FunctionCall();
        List <PlayInfo> playinfoList    = (List <PlayInfo>)getPlayInfoList.returnValue[0];

        ExternalFileSystem.SingleTon().SavePlayData(playinfoList);
    }
Пример #4
0
 // 몬스터 정보 로드. 수동형.
 public void GetCreatureInfo()
 {
     foreach (string filepath in creatureInfoPathList)
     {
         List <Creature> temp = ExternalFileSystem.SingleTon().GetCreatureInfo(filepath);
         creatureList.AddRange(temp);
     }
 }
Пример #5
0
    // 플레이 정보 등록.
    void getPlayInfo(string fileName)
    {
        List <string> infoStringList = ExternalFileSystem.SingleTon().GetPlayInfo(fileName);

        foreach (string infoString in infoStringList)
        {
            new Message("CreatePlayInfo : " + infoString).FunctionCall();
        }
    }
Пример #6
0
    // 인벤토리 정보를 불러오는 메소드.
    public void LoadInventory(Message message)
    {
        Debug.Log("InventoryManager/LoadInventory : is called.");
        List <string> itemDataList = ExternalFileSystem.SingleTon().LoadInventory();

        foreach (string itemData in itemDataList)
        {
            new Message("InventoryManager/ModifyItem : " + itemData).FunctionCall();
        }
    }
Пример #7
0
    // 플레이 정보 로드.
    void loadPlayData()
    {
        Debug.Log("PlayInfoManager.loadPlayData : is called");
        List <string> dataStringList = ExternalFileSystem.SingleTon().LoadPlayData();

        foreach (string dataString in dataStringList)
        {
            new Message("SetPlayInfo : " + dataString).FunctionCall();
        }
    }
Пример #8
0
    // 외부 파일에 저장된 아이템 리스트를 읽어와 저장하는 코드.
    private void LoadItemInfo()
    {
        List <string> itemInfoStringList = ExternalFileSystem.SingleTon().GetItemInfo(itemInfoPathList);
        string        code    = "";                  // 아이템 코드(중복 불가)
        string        type    = "";                  // 아이템 이름(중복 가능)
        string        name    = "";                  // 아이템 타입.
        string        tooltip = "";                  // 아이템 툴팁
        List <string> effect  = new List <string>(); // 아이템 효과(명령어 양식)

        foreach (string itemInfoString in itemInfoStringList)
        {
            // end를 만나면 묶어서 새로은 정보 등록.
            if (itemInfoString == "end")
            {
                // code 가 없으면 오류로 판단, 스킵.
                if (code == "")
                {
                    Debug.Log("InventoryManager/LoadItemInfo.error : No item code input.");
                    code    = "";
                    type    = "";
                    name    = "";
                    tooltip = "";
                    continue;
                }
                // type 이 없으면, general 로 초기화.
                if (type == "")
                {
                    type = "general";
                }
                // name 이 없으면 code 값으로 초기화.
                if (name == "")
                {
                    name = code;
                }
                // if (effect.Count == 0) effect.Add("None");
                Message msg = new Message($"InventoryManager/AddNewItem : {code}, {type}, {name}, {tooltip}");
                msg.args.Add(effect);
                msg.FunctionCall();
                Debug.Log($"InventoryManager/LoadItemInfo : [{code}] is added.");
                code    = "";
                type    = "";
                name    = "";
                tooltip = "";
                effect  = new List <string>();
            }
            // 그 외에는 정보에 대입.
            else
            {
                string[] temp  = itemInfoString.Split('=');
                string   mode  = temp[0].Trim();
                string   value = temp[1].Trim();
                if (mode == "short")
                {
                    Debug.Log("InventoryManager/LoadItemInfo : shortCut is detected.");
                    string[] shortInfoList = value.Split(',');
                    type    = shortInfoList[0].Trim();
                    code    = shortInfoList[1].Trim();
                    name    = shortInfoList[2].Trim();
                    tooltip = shortInfoList[3].Trim();
                    string effectString = "";
                    for (int i = 4; i < shortInfoList.Length; i++)
                    {
                        effectString += shortInfoList[i];
                    }
                    effectString = effectString.Trim();
                    if (effectString != "")
                    {
                        effect.Add(effectString);
                    }
                    // 반영.
                    Message msg = new Message($"InventoryManager/AddNewItem : {code}, {type}, {name}, {tooltip}");
                    msg.args.Add(effect);
                    msg.FunctionCall();
                    Debug.Log($"InventoryManager/LoadItemInfo : [{code}] is added.");
                    code    = "";
                    type    = "";
                    name    = "";
                    tooltip = "";
                    effect  = new List <string>();
                }
                else if (mode == "code")
                {
                    code = value;
                }
                else if (mode == "type")
                {
                    type = value;
                }
                else if (mode == "name")
                {
                    name = value;
                }
                else if (mode == "desc")
                {
                    tooltip = value;
                }
                else if (mode == "effect")
                {
                    effect.Add(value);
                }
            }
        }
    }
Пример #9
0
 // 아이템 소지 정보를 저장하는 메소드.
 public void SaveInventory(Message message)
 {
     Debug.Log("InventoryManager/SaveInventory : is called.");
     ExternalFileSystem.SingleTon().SaveInventory(itemBoxList);
 }
Пример #10
0
 bool loadQeust()
 {
     questList = ExternalFileSystem.SingleTon().LoadQeust(questNameList);
     return(true);
 }