public static bool Set(object o, TValue key, ref TValue value)
    {
        Reimu character = (Reimu)o;

        if (key.TtIsString())
        {
            switch (key.SValue())
            {
            case "x":
            {
                Vector2 pos = character.GetPosition();
                pos.x = (float)value.NValue;
                character.SetPosition(pos);
                return(true);
            }

            case "y":
            {
                Vector2 pos = character.GetPosition();
                pos.y = (float)value.NValue;
                character.SetPosition(pos);
                return(true);
            }
            }
        }
        value.SetSValue(string.Format("SetField of userData fail!Invalid key {0} for type {1}", key, typeof(Reimu).Name));
        return(false);
    }
Esempio n. 2
0
        public void Initialize()
        {
            CustomLocalizationManager.ImportCSV("influka/Touhou.csv", ';');
            clanRef = TouhouClan.Make();

            StatusEffectMarisaMagic.Make();

            AliceGift.Make();
            Alice.Make();

            Marisa.Make();
            Reimu.Make();

            TouhouClan.RegisterBanner();
            TouhouPlaceholder.Make();
        }
    public static bool Get(object o, TValue key, out TValue res)
    {
        Reimu character = (Reimu)o;

        res = new TValue();
        if (key.TtIsString())
        {
            switch (key.SValue())
            {
            case "x":
            {
                res.SetNValue(character.GetPosition().x);
                return(true);
            }

            case "y":
            {
                res.SetNValue(character.GetPosition().y);
                return(true);
            }

            case "SetPos":
            {
                res.SetClCsValue(_funcSetPos);
                return(true);
            }

            case "GetPos":
            {
                res.SetClCsValue(_funcGetPos);
                return(true);
            }

            case "characterIndex":
            {
                res.SetNValue(character.CharacterIndex);
                return(true);
            }
            }
        }
        res.SetSValue(string.Format("GetField from userData fail!Invalid key {0} for type {1}", key, typeof(Reimu).Name));
        return(false);
    }