Example #1
0
        public override int GetHashCode()
        {
            int translatehascod = Translate.GetHashCode();
            int wordidhascode   = WordId.GetHashCode();

            return(wordidhascode ^ translatehascod);
        }
 WordSet GetWord(WordId id)
 {
     if (!isInitialized)
     {
         Init();
     }
     return(wordLibrary.SafeGetValue(id));
 }
    public string GetText(WordId id, SystemLanguage lang)
    {
        var word = GetWord(id);

        if (word == null)
        {
            return("");
        }
        return(word.GetWord(lang));
    }
    public string GetText(WordId id)
    {
        var word = GetWord(id);

        if (word == null)
        {
            return("");
        }
        return(word.GetWord(GetLang()));
    }
Example #5
0
    public static VisitedEvent Serdes(int n, VisitedEvent u, AssetMapping mapping, ISerializer s)
    {
        if (s == null)
        {
            throw new ArgumentNullException(nameof(s));
        }

        u ??= new VisitedEvent();
        s.Begin();
        u.Unk0       = s.UInt8(nameof(Unk0), u.Unk0);
        u.EventSetId = EventSetId.SerdesU16(nameof(EventSetId), u.EventSetId, mapping, s);
        u.Type       = s.EnumU8(nameof(Type), u.Type);

        switch (u.Type)
        {
        case ActionType.AskAboutItem:
        case ActionType.UseItem:
        case ActionType.EquipItem:
        case ActionType.UnequipItem:
        case ActionType.PickupItem:
            u._value = ItemId.SerdesU16("Value", ItemId.FromUInt32(u._value), AssetType.Item, mapping, s).ToUInt32();
            break;

        case ActionType.Word:
            u._value = WordId.SerdesU16("Value", WordId.FromUInt32(u._value), mapping, s).ToUInt32();
            break;

        default:
            u._value = s.UInt16("Value", (ushort)u._value);
            break;
        }

        if (s.IsCommenting())
        {
            s.Comment(u.ToString());
        }
        s.End();
        return(u);
    }
Example #6
0
 public class Word : ConversationTrigger { public Word(WordId wordId) => WordId = wordId; public WordId WordId {