コード例 #1
0
        public StoryData Fetch(StoryData data)
        {
            if (data.AssignedTo != 0)
            {
                data.AssignedToUser = MockDb.Users
                    .Where(row => row.UserId == data.AssignedTo)
                    .Single();
            }

            data.Project = MockDb.Projects
                .Where(row => row.ProjectId == data.ProjectId)
                .Single();

            if (data.SprintId != 0)
            {
                data.Sprint = MockDb.Sprints
                     .Where(row => row.SprintId == data.SprintId)
                     .Single();
            }

            data.Status = MockDb.Statuses
                .Where(row => row.StatusId == data.StatusId)
                .Single();

            data.CreatedByUser = MockDb.Users
                .Where(row => row.UserId == data.CreatedBy)
                .Single();

            data.ModifiedByUser = MockDb.Users
                .Where(row => row.UserId == data.ModifiedBy)
                .Single();

            return data;
        }
コード例 #2
0
ファイル: Panel_Main.cs プロジェクト: ancongsheng/vu_paradox
    private void next()
    {
        data = MainGame.instance.text[MainGame.instance.currentID];

        if (skipRead && PlayerData.GetTextFlag(MainGame.instance.currentID))
        {
            Time.timeScale = 10f;
        }
        else
        {
            Time.timeScale = 1f;
        }

        idx = 0;
        showText = new StringBuilder();
        m_NextBtn.gameObject.SetActive(false);

        switch ((ContentType)data.type)
        {
            case ContentType.Select:
                m_SelectPanel.Set(data);
                inPause = true;
                m_SelectPanel.Show();
                break;
            case ContentType.PassiveSelect:
                string[] split = data.content.Split('+');

                for (int i = 0; i < split.Length; i++)
                {
                    int cid = int.Parse(split[i]);
                    int requireID = MainGame.instance.selection[cid].requireId;
                    if (MainGame.instance.checkCondition(requireID))
                    {
                        onSelectEnd(cid);
                        return;
                    }
                }

                MainGame.instance.currentID = data.next;
                next();
                break;
            case ContentType.End:
                inPause = true;
                UIManager.ShowPanel("Ending_Panel");
                break;
            default:
                m_ShowText.text = string.Empty;
                if (data.name != string.Empty)
                {
                    m_NameGroup.SetActive(true);
                    m_ShowName.text = data.name;
                }
                else
                {
                    m_NameGroup.SetActive(false);
                }
                inPause = false;
                break;
        }
    }
コード例 #3
0
    public static StoryData saveStory(Story story)
    {
        Debug.Log("Saving story: " + story.name);
        StoryData storyToSerialize = new StoryData(story);

        Type[]        extraTypes = { typeof(ComponentData) };
        XmlSerializer ser        = new XmlSerializer(typeof(StoryData), extraTypes);
        FileStream    fs         = new FileStream(Application.dataPath + "/StreamingAssets/XML/" + storyToSerialize.name + "_data.xml", FileMode.Create);

        ser.Serialize(fs, storyToSerialize);
        fs.Close();
        return(storyToSerialize);
    }
コード例 #4
0
        public ActionResult ManageAchievementStory(int instanceID, string storyText = null, HttpPostedFileBase storyImage = null)
        {
            UnitOfWork work = new UnitOfWork();

            if (!HttpContext.Request.IsAjaxRequest() || work.AchievementRepository.InstanceExists(instanceID) == null)
            {
                return(new HttpStatusCodeResult(406, "Invalid request")); // Invalid request
            }
            try
            {
                var image = false;
                var text  = false;

                // TODO: Change for editing, should init to null or existing image filepath
                String imagePath = null;
                if (storyImage != null)
                {
                    if (!Utilities.JPPImage.FileIsWebFriendlyImage(storyImage.InputStream))
                    {
                        return(new HttpStatusCodeResult(406, "Invalid image type")); // Invalid image type
                    }
                    Utilities.JPPDirectory.CheckAndCreateUserDirectory(WebSecurity.CurrentUserId, Server);
                    String filepath = Utilities.JPPDirectory.CreateFilePath(Utilities.JPPDirectory.ImageTypes.UserStory, WebSecurity.CurrentUserId);
                    Utilities.JPPImage.Save(Server, filepath, storyImage.InputStream, 1000, 200, false);
                    work.AchievementRepository.UserAddAchievementStoryImage(instanceID, filepath);
                    imagePath = filepath;
                    image     = true;
                }
                if (!String.IsNullOrWhiteSpace(storyText))
                {
                    work.AchievementRepository.UserAddAchievementStoryText(instanceID, storyText);
                    text = true;
                }

                if (!image && !text)
                {
                    return(new HttpStatusCodeResult(406, "Empty story form submission")); // Empty form submission
                }
                StoryData storyResult = new StoryData()
                {
                    StoryText  = storyText,
                    StoryImage = imagePath
                };

                return(Json(storyResult));
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeResult(500, "Save story exception")); // Invalid request;
            }
        }
コード例 #5
0
    void Start()
    {
        dataController   = FindObjectOfType <DataController>();
        currentStoryData = dataController.GetCurrentStoryData();
        scenePool        = currentStoryData.scenes;
        //timeRemaining = currentRoundData.timeLimitInSeconds;
        UpdateTimeRemainingDisplay();

        // playerScore = 0;
        sceneIndex = 0;

        ShowScene();
        isGameActive = true;
    }
コード例 #6
0
    public void SetStoryData(StoryData data)
    {
        storyData = data;
        if (titleText != null)
        {
            titleText.textComponent.SetText(storyData.title);
        }
        if (descText != null)
        {
            descText.textComponent.SetText(storyData.description);
        }

        SetIcon(storyData.icon);
    }
コード例 #7
0
    private void ShowTextAfterTp()
    {
        writer.enabled = true;
        canUseE        = true;
        if (data.cout > 0)
        {
            //if (dataList[0].spriteName != eventSpriteName)
            //{
            //    eventSpriteName = dataList[0].spriteName;
            //}
            string text = data.SpeakList[data.index];
            if (text.Contains("*"))
            {
                string[] sArrary = text.Split('*');
                text = sArrary[0];
            }
            if (text.Length > 60)
            {
                addText = text.Substring(60, text.Length - 61);
                text    = text.Substring(0, 60);
            }
            //nameLabel.text = dataList[index].name;
            speakLabel.text = text;
        }
        //else if (data != null)
        //{
        //    string text = data.SpeakList[data.index];

        //    if (text.Length > 40)
        //    {

        //        addText = text.Substring(40, text.Length - 41);
        //        text = text.Substring(0, 40);
        //    }
        //    //nameLabel.text = data.name;
        //    speakLabel.text = text;

        //}
        if (bg_GameObject.activeSelf == false)
        {
            bg_GameObject.SetActive(true);
            TweenAlpha ta = bg_GameObject.GetComponent <TweenAlpha>();
            ta.enabled = true;
            ta.ResetToBeginning();
        }
        writer.ResetToBeginning();
        IEnumeratorManager.Instance.StartCoroutine(SetAcitveSpeakLabel_Delay());
        curData = data;
    }
コード例 #8
0
ファイル: IBM_API.cs プロジェクト: U3DC/Storybook
    void Start()
    {
        customFoundWords = new List <string>();
        storyData        = GetComponent <StoryData> ();

        Credentials analyze_cred = new Credentials("dfb6ed8f-ca63-4c3f-8723-95c92aebaa83",
                                                   "bbNFyUD1LMDg", "https://gateway.watsonplatform.net/natural-language-understanding/api");

        _naturalLanguageUnderstanding = new NaturalLanguageUnderstanding(analyze_cred);

        Credentials textSpeech_cred = new Credentials("4f7ef3c9-414a-463e-bd94-200da766011b",
                                                      "QVPX0Zz66Dbb", "https://stream.watsonplatform.net/text-to-speech/api");

        _textToSpeech = new TextToSpeech(textSpeech_cred);
    }
コード例 #9
0
        public StoryData Fetch(StoryDataCriteria criteria)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var story = this.Fetch(ctx, criteria)
                    .Single();

                var storyData = new StoryData();

                this.Fetch(story, storyData);

                return storyData;
            }
        }
コード例 #10
0
        public StoryData Fetch(StoryDataCriteria criteria)
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var story = this.Fetch(ctx, criteria)
                            .Single();

                var storyData = new StoryData();

                this.Fetch(story, storyData);

                return(storyData);
            }
        }
コード例 #11
0
        public StoryData Insert(StoryData data)
        {
            if (MockDb.Stories.Count() == 0)
            {
                data.StoryId = 1;
            }
            else
            {
                data.StoryId = MockDb.Stories.Select(row => row.StoryId).Max() + 1;
            }

            MockDb.Stories.Add(data);

            return(data);
        }
コード例 #12
0
    //public StoryData GetStoryDataByID(int id)
    //{
    //    if (StoryDic == null)
    //    {
    //        StoryDic = new Dictionary<int, StoryData>();
    //        LoadStoryXML("StoryConfig",StoryDic);
    //    }
    //    StoryData data = null;
    //    if (!StoryDic.TryGetValue(id, out data))
    //    {
    //        Debug.LogError("not data in storyDic");
    //        return null;
    //    }
    //    return data;
    //}


    public StoryData GetState0DataByID(int id)
    {
        if (Stage0Dic == null)
        {
            Stage0Dic = new Dictionary <int, StoryData>();
            LoadStoryXML("Stage0Config", Stage0Dic);
        }
        StoryData data = null;

        if (!Stage0Dic.TryGetValue(id, out data))
        {
            Debug.LogError("not data in storyDic");
            return(null);
        }
        return(data);
    }
コード例 #13
0
    public override void OnInspectorGUI()
    {
        var storyData = target as StoryData;

        activeData = storyData;

        storyData.title       = EditorGUILayout.TextField("Title", storyData.title);
        storyData.description = EditorGUILayout.TextField("Description", storyData.description);
        displayActions        = EditorGUILayout.Foldout(displayActions, "Actions");
        if (displayActions)
        {
            DisplayActions(storyData);
        }

        EditorUtility.SetDirty(storyData);
    }
コード例 #14
0
 /// <summary>
 /// returns Topic Pool from listOfHqStories based on input topicPool.name. Returns null if not found
 /// </summary>
 /// <param name="poolName"></param>
 /// <returns></returns>
 public TopicPool GetHqTopicPool(string poolName)
 {
     if (string.IsNullOrEmpty(poolName) == false)
     {
         StoryData storyData = listOfHqStories.Find(x => x.pool.name.Equals(poolName, StringComparison.Ordinal) == true);
         if (storyData != null)
         {
             return(storyData.pool);
         }
     }
     else
     {
         Debug.LogWarning("Invalid poolName (Null or Empty)");
     }
     return(null);
 }
コード例 #15
0
    //Start the dialogue with the given character
    public void startNewDialogue(StoryData d, Sprite s, string n, GameObject screen)
    {
        dialogueScreen = screen;

        dialogueScreen.GetComponent <Animator>().SetBool("Open", true);
        characterName.text = n;
        dialogueFinished   = false;
        _data          = d;
        startDialogue  = true;
        spawnedChoices = false;

        if (d.getQuestToComplete() != null)
        {
            Player.instance.playerQuests.questCompleted(d.getQuestToComplete());
        }
    }
コード例 #16
0
    public void Set(StoryData data)
    {
        string[] split = data.content.Split('+');
        int      i     = 0;

        for (i = 0; i < split.Length; i++)
        {
            m_SelectItems[i].Set(int.Parse(split[i]));
        }

        while (i < m_SelectItems.Count)
        {
            m_SelectItems[i].gameObject.SetActive(false);
            i++;
        }
    }
コード例 #17
0
ファイル: SelectPanel.cs プロジェクト: ancongsheng/vu_paradox
    public void Set(StoryData data)
    {
        string[] split = data.content.Split('+');
        int i = 0;

        for (i = 0; i < split.Length; i++ )
        {
            m_SelectItems[i].Set(int.Parse(split[i]));
        }

        while (i < m_SelectItems.Count)
        {
            m_SelectItems[i].gameObject.SetActive(false);
            i++;
        }
    }
コード例 #18
0
    /// <summary>
    /// 주인공 정보를 ScriptableObject로 생성
    /// </summary>
    static void MakeStoryData()
    {
        // ScriptableObejct 인스턴스 생성
        StoryData data = ScriptableObject.CreateInstance <StoryData>();

        // ScriptableObject를 파일로 생성
        AssetDatabase.CreateAsset((ScriptableObject)data, storyExportPath);
        // 생성된 파일을 에디터에서 수정하지 못하게 설정.
        data.hideFlags = HideFlags.NotEditable;
        // 데이터 초기화.
        data.list.Clear();

        // 엑셀 파일 Open
        using (FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read))
        {
            // open된 엑셀 파일을 메모리에 생성.
            IWorkbook book = new XSSFWorkbook(stream);
            // 두번째  Sheet 열기.
            ISheet sheet = book.GetSheetAt(1);

            // 2번째 줄(row)부터 읽기.
            for (int ix = 1; ix <= sheet.LastRowNum; ++ix)
            {
                // 줄 (row) 읽기.
                IRow row = sheet.GetRow(ix);
                // Serialization을 위해서 임시 객체 생성
                StoryData.Attribute a = new StoryData.Attribute();

                // 각 데이터 항목 설정.
                // a.scene = row.GetCell(0).StringCellValue;
                a.character = (string)row.GetCell(1).StringCellValue;
                a.log       = (string)row.GetCell(2).StringCellValue;
                a.fontSize  = (float)row.GetCell(3).NumericCellValue;
                //    a.background = (string)row.GetCell(4).StringCellValue;
                // 리스트에 정보 추가
                data.list.Add(a);
            }

            stream.Close();
        }

        // 위에서 생성한 ScriptableObject 파일 찾기.
        ScriptableObject obj = AssetDatabase.LoadAssetAtPath(storyExportPath, typeof(ScriptableObject)) as ScriptableObject;

        // 디스크에 쓰기.
        EditorUtility.SetDirty(obj);
    }
コード例 #19
0
ファイル: StoryScreen.cs プロジェクト: StaphiX/Story
    public void AddStoryTile(StoryData data)
    {
        Debug.Log("Add Story Tile");
        RectTransform content  = scrollView.content;
        float         contentY = content.anchoredPosition.y;

        RectTransform tileTransfrom = Main.UIManager.InstantiateUI("UI/StoryTile", content);

        tileTransfrom.anchoredPosition = new Vector2(0, contentY);

        StoryTile storyTile = tileTransfrom.GetComponent <StoryTile>();

        if (storyTile != null)
        {
            storyTile.SetStoryData(data);
        }
    }
コード例 #20
0
    private void LoadStoryData()
    {
        string dataPath = "datas/Storys.xml";
        var    asset    = XmlHelper.LoadXml(dataPath);

        if (asset != null)
        {
            for (int i = 0; i < asset.Children.Count; i++)
            {
                var dataNode  = asset.Children[i] as SecurityElement;
                var storyData = new StoryData();
                storyData.id        = dataNode.Attribute("id").ToUint();
                storyData.name      = dataNode.Attribute("name");
                storyData.pageDatas = new Dictionary <uint, PageData>();

                if (dataNode.Children != null)
                {
                    for (int j = 0; j < dataNode.Children.Count; j++)
                    {
                        var pageNode = dataNode.Children[j] as SecurityElement;
                        var pageData = new PageData();
                        pageData.id          = pageNode.Attribute("id").ToUint();
                        pageData.title       = pageNode.Attribute("title");
                        pageData.dialogDatas = new Dictionary <uint, DialogData>();

                        if (pageNode.Children != null)
                        {
                            for (int x = 0; x < pageNode.Children.Count; x++)
                            {
                                var dialogNode = pageNode.Children[x] as SecurityElement;

                                var dialogData = new DialogData();
                                dialogData.id         = dialogNode.Attribute("id").ToUint();
                                dialogData.roleid     = dialogNode.Attribute("role").ToUint();
                                dialogData.posid      = dialogNode.Attribute("pos").ToUint();
                                dialogData.txtContent = dialogNode.Attribute("text");
                                pageData.dialogDatas.Add(dialogData.id, dialogData);
                            }
                        }
                        storyData.pageDatas.Add(pageData.id, pageData);
                    }
                }
                storyDatas.Add(storyData.id, storyData);
            }
        }
    }
コード例 #21
0
        public StoryData Insert(StoryData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var story = new Story();

                DataMapper.Map(data, story);

                ctx.ObjectContext.AddToStories(story);

                ctx.ObjectContext.SaveChanges();

                data.StoryId = story.StoryId;

                return(data);
            }
        }
コード例 #22
0
ファイル: Story.cs プロジェクト: RuLap/DungeonTrip
    void Start()
    {
        string name = PlayerStats.LoadFromJson().name;

        isIntro   = SceneManager.GetActiveScene().name == "Beginning" ? true : false;
        storyText = GetComponentInChildren <Text>();
        if (isIntro)
        {
            data = StoryData.CreateFromJSON("I");
        }
        else
        {
            data = StoryData.CreateFromJSON("E");
        }
        data.story = data.story.Replace("{Имя главного героя}", name);
        sentences  = data.story.Split('|');
        StartCoroutine(PrintText());
        skipText.enabled = false;
    }
コード例 #23
0
        public StoryData Update(StoryData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var story =
                    new Story
                {
                    StoryId = data.StoryId
                };

                ctx.ObjectContext.Stories.Attach(story);

                DataMapper.Map(data, story);

                ctx.ObjectContext.SaveChanges();

                return(data);
            }
        }
コード例 #24
0
    public StoryVisuals CreateStory(StoryData sd, System.Action finishedAction)
    {
        GlobalEvents.StoryStarted();

        var visuals = CreateStoryVisuals();

        visuals.Setup(sd.title, sd.description);
        visuals.storyFinishedEvent += () =>
        {
            GlobalEvents.StoryFinished();
            finishedAction();
        };

        foreach (var sad in sd.actions)
        {
            visuals.AddAction(CreateActionFromData(sad, () => visuals.Finished()));
        }

        return(visuals);
    }
コード例 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //testing Arena DB Connection...
        Story story = new Story(1);


        DataTable storyTable = new StoryData().GetStoryList_DT("");



        ListObjectsResponse response = awsHelper.ListingObjects("MoreFiles/", 100);

        foreach (var item in response.S3Objects)
        {
            Response.Write("<a target='_blank' href='" + awsHelper.GeneratePreSignedURL("MoreFiles", item.Key) + "'>Link</a>");
        }

        lvDetail.DataSource = response.S3Objects;
        lvDetail.DataBind();
    }
コード例 #26
0
 protected void Update(StoryData data)
 {
     data.StoryId                = this.StoryId;
     data.AssignedTo             = this.AssignedTo;
     data.AssignedDate           = this.AssignedDate;
     data.CompletedDate          = this.CompletedDate;
     data.Description            = this.Description;
     data.Duration               = this.Duration;
     data.EstimatedCompletedDate = this.EstimatedCompletedDate;
     data.EstimatedDuration      = this.EstimatedDuration;
     data.IsArchived             = this.IsArchived;
     data.IsCompleted            = this.IsCompleted;
     data.ProjectId              = this.ProjectId;
     data.SprintId               = this.SprintId;
     data.StartDate              = this.StartDate;
     data.StatusId               = this.StatusId;
     data.ModifiedBy             = this.ModifiedBy;
     data.ModifiedDate           = this.ModifiedDate;
     data.CreatedBy              = this.CreatedBy;
     data.CreatedDate            = this.CreatedDate;
 }
コード例 #27
0
        protected override void DataPortal_Update()
        {
            using (var dalManager = DataFactoryManager.GetManager())
            {
                var dalFactory = dalManager.GetProvider <IStoryDataFactory>();

                var data = new StoryData();

                using (this.BypassPropertyChecks)
                {
                    this.ModifiedBy   = ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId;
                    this.ModifiedDate = DateTime.Now;

                    this.Update(data);

                    data = dalFactory.Update(data);
                }

                // this.FieldManager.UpdateChildren(data);
            }
        }
コード例 #28
0
ファイル: SaveSystem.cs プロジェクト: zouuh/FallOfTelladena
    public static StoryData LoadStory()
    {
        string path = Application.persistentDataPath + "/story.sol";

        // Debug.Log(path);
        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);

            StoryData data = formatter.Deserialize(stream) as StoryData;
            stream.Close();

            return(data);
        }
        else
        {
            Debug.LogError("Save file not found in" + path);
            return(null);
        }
    }
コード例 #29
0
 internal static void Map(StoryData source, Story destination)
 {
     destination.StoryId                = source.StoryId;
     destination.AssignedTo             = source.AssignedTo;
     destination.AssignedDate           = source.AssignedDate;
     destination.CompletedDate          = source.CompletedDate;
     destination.Description            = source.Description;
     destination.Duration               = source.Duration;
     destination.EstimatedCompletedDate = source.EstimatedCompletedDate;
     destination.EstimatedDuration      = source.EstimatedDuration;
     destination.IsArchived             = source.IsArchived;
     destination.IsCompleted            = source.IsCompleted;
     destination.ProjectId              = source.ProjectId;
     destination.SprintId               = source.SprintId;
     destination.StartDate              = source.StartDate;
     destination.StatusId               = source.StatusId;
     destination.ModifiedBy             = source.ModifiedBy;
     destination.ModifiedDate           = source.ModifiedDate;
     destination.CreatedBy              = source.CreatedBy;
     destination.CreatedDate            = source.CreatedDate;
 }
コード例 #30
0
        public StoryData[] FetchLookupInfoList(StoryDataCriteria criteria)
        {
            using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities>
                             .GetManager(Database.ApplicationConnection, false))
            {
                var stories = this.Fetch(ctx, criteria)
                              .AsEnumerable();

                var storyDataList = new List <StoryData>();

                foreach (var story in stories)
                {
                    var storyData = new StoryData();

                    this.Fetch(story, storyData);

                    storyDataList.Add(storyData);
                }

                return(storyDataList.ToArray());
            }
        }
コード例 #31
0
        public StoryData[] FetchLookupInfoList(StoryDataCriteria criteria)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                          .GetManager(Database.ApplicationConnection, false))
            {
                var stories = this.Fetch(ctx, criteria)
                    .AsEnumerable();

                var storyDataList = new List<StoryData>();

                foreach (var story in stories)
                {
                    var storyData = new StoryData();

                    this.Fetch(story, storyData);

                    storyDataList.Add(storyData);
                }

                return storyDataList.ToArray();
            }
        }
コード例 #32
0
ファイル: StoryEditor.cs プロジェクト: KianBennett/Lordship
    void OnGUI()
    {
        StoryData          data     = StoryData.LoadData();
        SerializedObject   dataObj  = new SerializedObject(data);
        SerializedProperty beatList = dataObj.FindProperty("_beats");

        EditorGUILayout.BeginVertical();
        _scroll = EditorGUILayout.BeginScrollView(_scroll);

        if (_view == View.Beat && _currentIndex != -1)
        {
            OnGUI_BeatView(beatList, _currentIndex);
        }
        else
        {
            OnGUI_ListView(beatList);
        }

        EditorGUILayout.EndScrollView();
        EditorGUILayout.EndVertical();

        dataObj.ApplyModifiedProperties();
    }
コード例 #33
0
    public void DisplayActions(StoryData data)
    {
        EditorGUI.indentLevel++;

        if (data.actions == null)
        {
            data.actions = new List <StoryActionData>();
        }
        int newSize = EditorGUILayout.IntField("size", data.actions.Count);

        EditorHelper.UpdateList(ref data.actions, newSize, CreateNewActionData, DestroyAction);
        EditorHelper.UpdateList(ref actionEditors, newSize, () => null, (e) => {});

        EditorGUI.indentLevel++;

        for (int i = 0; i < actionEditors.Count; i++)
        {
            DisplayAction(i);
        }

        EditorGUI.indentLevel--;
        EditorGUI.indentLevel--;
    }
コード例 #34
0
    void LoadStoryXML(string pathName, Dictionary <int, StoryData> DataDic)
    {
        string path = "Config";

        string      text   = ResourcesManager.Instance.LoadConfig(path, pathName).text;
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.LoadXml(text);

        XmlNode     node     = xmlDoc.SelectSingleNode("Story");
        XmlNodeList nodeList = node.ChildNodes;

        foreach (XmlNode item in nodeList)
        {
            XmlNode id        = item.SelectSingleNode("id");
            XmlNode index     = item.SelectSingleNode("index");
            XmlNode state     = item.SelectSingleNode("State");
            XmlNode name      = item.SelectSingleNode("name");
            XmlNode cout      = item.SelectSingleNode("cout");
            XmlNode speak     = item.SelectSingleNode("Speak");
            XmlNode modelName = item.SelectSingleNode("spriteName");

            StoryData data = new StoryData();
            data.id        = CommonHelper.Str2Int(id.InnerText);
            data.state     = CommonHelper.Str2Int(state.InnerText);
            data.name      = name.InnerText;
            data.index     = CommonHelper.Str2Int(index.InnerText);
            data.cout      = CommonHelper.Str2Int(cout.InnerText);
            data.modelName = modelName.InnerText;

            foreach (XmlNode pair in speak)
            {
                data.SpeakList.Add(pair.InnerText);
            }
            DataDic.Add(data.id, data);
        }
    }
コード例 #35
0
ファイル: DataMapper.cs プロジェクト: mattruma/epiworx-csla
 internal static void Map(StoryData source, Story destination)
 {
     destination.StoryId = source.StoryId;
     destination.AssignedTo = source.AssignedTo;
     destination.AssignedDate = source.AssignedDate;
     destination.CompletedDate = source.CompletedDate;
     destination.Description = source.Description;
     destination.Duration = source.Duration;
     destination.EstimatedCompletedDate = source.EstimatedCompletedDate;
     destination.EstimatedDuration = source.EstimatedDuration;
     destination.IsArchived = source.IsArchived;
     destination.IsCompleted = source.IsCompleted;
     destination.ProjectId = source.ProjectId;
     destination.SprintId = source.SprintId;
     destination.StartDate = source.StartDate;
     destination.StatusId = source.StatusId;
     destination.ModifiedBy = source.ModifiedBy;
     destination.ModifiedDate = source.ModifiedDate;
     destination.CreatedBy = source.CreatedBy;
     destination.CreatedDate = source.CreatedDate;
 }
コード例 #36
0
        public StoryData Update(StoryData data)
        {
            var story = MockDb.Stories
                .Where(row => row.StoryId == data.StoryId)
                .Single();

            Csla.Data.DataMapper.Map(data, story);

            return data;
        }
コード例 #37
0
 protected void Insert(StoryData data)
 {
     this.Update(data);
 }
コード例 #38
0
        public StoryData Insert(StoryData data)
        {
            if (MockDb.Stories.Count() == 0)
            {
                data.StoryId = 1;
            }
            else
            {
                data.StoryId = MockDb.Stories.Select(row => row.StoryId).Max() + 1;
            }

            MockDb.Stories.Add(data);

            return data;
        }
コード例 #39
0
        public StoryData Update(StoryData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var story =
                    new Story
                    {
                        StoryId = data.StoryId
                    };

                ctx.ObjectContext.Stories.Attach(story);

                DataMapper.Map(data, story);

                ctx.ObjectContext.SaveChanges();

                return data;
            }
        }
コード例 #40
0
        private void Fetch(Story story, StoryData storyData)
        {
            DataMapper.Map(story, storyData);

            storyData.AssignedToUser = new UserData();
            if (story.AssignedTo != 0)
            {
                DataMapper.Map(story.AssignedToUser, storyData.AssignedToUser);
            }

            storyData.Project = new ProjectData();
            DataMapper.Map(story.Project, storyData.Project);

            storyData.Sprint = new SprintData();
            if (story.SprintId != 0)
            {
                DataMapper.Map(story.Sprint, storyData.Sprint);
            }

            storyData.Status = new StatusData();
            storyData.IsOpened = story.Status.IsStarted;
            storyData.IsCompleted = story.Status.IsCompleted;
            DataMapper.Map(story.Status, storyData.Status);

            storyData.CreatedByUser = new UserData();
            DataMapper.Map(story.CreatedByUser, storyData.CreatedByUser);

            storyData.ModifiedByUser = new UserData();
            DataMapper.Map(story.ModifiedByUser, storyData.ModifiedByUser);
        }
コード例 #41
0
        public StoryData Insert(StoryData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var story = new Story();

                DataMapper.Map(data, story);

                ctx.ObjectContext.AddToStories(story);

                ctx.ObjectContext.SaveChanges();

                data.StoryId = story.StoryId;

                return data;
            }
        }
コード例 #42
0
ファイル: MainGame.cs プロジェクト: ancongsheng/vu_paradox
    private void parseData()
    {
        string[] itemRowsList = ResourceManager.LoadText("main.text");
        text.Clear();

        //Skip first three lines.
        for (int i = 3; i < itemRowsList.Length; ++i)
        {
            string[] itemColumnsList = itemRowsList[i].Split('\t');
            if (itemColumnsList.Length < 3)
            {
                Debug.LogWarning("The source data seems to have an inconsistent number of columns: " + itemColumnsList.Length);
                continue;
            }

            StoryData data = new StoryData(itemColumnsList);
            text.Add(data.id, data);

        }

        itemRowsList = ResourceManager.LoadText("main.selection");
        selection.Clear();

        //Skip first three lines.
        for (int i = 3; i < itemRowsList.Length; ++i)
        {
            string[] itemColumnsList = itemRowsList[i].Split('\t');
            if (itemColumnsList.Length < 3)
            {
                Debug.LogWarning("The source data seems to have an inconsistent number of columns: " + itemColumnsList.Length);
                continue;
            }

            SelectionData data = new SelectionData(itemColumnsList);
            selection.Add(data.id, data);

        }

        itemRowsList = ResourceManager.LoadText("main.condition");
        condition.Clear();

        //Skip first three lines.
        for (int i = 3; i < itemRowsList.Length; ++i)
        {
            string[] itemColumnsList = itemRowsList[i].Split('\t');
            if (itemColumnsList.Length < 3)
            {
                Debug.LogWarning("The source data seems to have an inconsistent number of columns: " + itemColumnsList.Length);
                continue;
            }

            ConditionData data = new ConditionData(itemColumnsList);
            condition.Add(data.id, data);

        }
    }