Exemplo n.º 1
0
        public void UpdateTags(List <string> removeTags, List <string> addTags)
        {
            foreach (string removeTag in removeTags)
            {
                line_.tags_.Remove(removeTag);
                TagParent tagParent = GameContext.TagList.GetTagParent(removeTag);
                if (tagParent != null)
                {
                    tagParent.RemoveLine(line_);
                }
            }
            foreach (string addTag in addTags)
            {
                line_.tags_.Add(addTag);
                TagParent tagParent = GameContext.TagList.GetOrInstantiateTagParent(addTag);
                if (tagParent != null)
                {
                    tagParent.InstantiateTaggedLine(line_);
                }
            }

            if (line_.Field != null && line_.Field.BindedLine == line_)
            {
                line_.Field.SetHashTags(line_.tags_);
            }
        }
Exemplo n.º 2
0
    public void Insert(int index, Line child)
    {
        Line oldParent = child.parent_;

        if (oldParent == this)
        {
            children_.Move(child.Index, index);
        }
        else
        {
            children_.Insert(index, child);
            child.Tree    = Tree;
            child.parent_ = this;
            if (oldParent != null)
            {
                oldParent.children_.Remove(child);
            }
        }

        child.OnFoundParent();

        if (child.Tree is LogTree == false)
        {
            foreach (string tag in child.Tags)
            {
                bool      add       = (child.IsDone == false);
                TagParent tagParent = GameContext.TagList.GetTagParent(tag);
                if (tagParent == null)
                {
                    // Doneしてないタグなら生成する
                    if (add)
                    {
                        tagParent = GameContext.TagList.InstantiateTagParent(tag);
                    }
                }
                else
                {
                    // DoneしててもRepeatなら追加してよい
                    add |= tagParent.IsRepeat;
                }
                add &= tagParent != null && tagParent.FindBindedLine(child) == null;
                if (add)
                {
                    tagParent.InstantiateTaggedLine(child);
                }
            }

            if (child.Field != null)
            {
                child.Field.SetHashTags(child.tags_);
            }
        }
    }
Exemplo n.º 3
0
    public void AddTag(string tag)
    {
        tags_.Add(tag);
        text_ = String.Format("{0} #{1}", text_, tag);
        if (Field != null)
        {
            Field.SetTextDirectly(text_);
            Field.SetHashTags(tags_);
        }
        TagParent tagParent = GameContext.TagList.GetOrInstantiateTagParent(tag);

        tagParent.InstantiateTaggedLine(this);
    }