private void SerializeUse(UseBase use) { _writer.WriteStartObject(); _writer.WriteProperty("type", "node"); _writer.WriteProperty("kind", use.GetType().Name); SerializeSpanProperty(use.Span); _writer.WritePropertyStartArray("children"); if (use is SimpleUse simpleUse) { SerializeToken(nameof(simpleUse.HasSeparateAlias), simpleUse.HasSeparateAlias.ToString(), null); SerializeToken(nameof(simpleUse.QualifiedName), simpleUse.QualifiedName.ToString(), simpleUse.NameSpan); SerializeToken(nameof(simpleUse.Alias), simpleUse.Alias.Name.ToString(), simpleUse.AliasSpan); } else { var groupUse = (GroupUse)use; groupUse.Uses.Foreach(SerializeUse); } _writer.WriteEndArray(); _writer.WriteEndObject(); }
protected virtual void VisitUse(UseBase use) { throw new NotImplementedException(); }
public override void UseSet() { useBase = new UseBase(new int[] { -1 }, new string[] { "移動する" }, new string[] { "えらーありえない" }); }
public override void UseSet() { useBase = new UseBase(new int[] { -1 }, new string[] { "前に押す" }, new string[] { "押せなさそうだ" }); }
public override void UseSet() { useBase = new UseBase(new int[] { -1 }, new string[] { "飛び降りる" }, new string[] { "飛び降りれなさそうだ" }); }
public override void UseSet() { useBase = new UseBase(new int[] { -1, (int)Utility.ItemId.Match }, new string[] { "前に押す", "マッチを使用 燃やす" }, new string[] { "押せなさそうだ", "マッチが必要" }); }
public override void UseSet() { useBase = new UseBase(new int[] { (int)Utility.ItemId.Ono, (int)Utility.ItemId.Match }, new string[] { "斧を使用 切り倒す", "マッチを使用 燃やす" }, new string[] { "斧が必要", "マッチが必要" }); }
public override void UseSet() { useBase = new UseBase(new int[] { (int)Utility.ItemId.Baketu }, new string[] { "水を汲む" }, new string[] { "空バケツが必要" }); }
public override void UseSet() { useBase = new UseBase(new int[] { (int)Utility.ItemId.Hammer }, new string[] { "ハンマーを使用 壊す" }, new string[] { "ハンマーが必要" }); }