예제 #1
0
 public void MinusOneTestInit()
 {
     array = new int[5] {
         1, 2, 3, 4, 5
     };
     minusOne = new MinusOne(array);
 }
예제 #2
0
    public void CharapterInspector(XmlNode charXml)
    {
        MinusOne minusOne = (string x) =>
        {
            string[] y = x.Split(',');
            int[]    z = new int[y.Length];
            for (int i = 0; i < y.Length; i++)
            {
                z[i] = int.Parse(y[i]) - 1;
            }
            return(z);
        };

        string mode = charXml.Attributes["mode"].Value;
        string type = charXml.Attributes["type"].Value;

        switch (mode)
        {
        case "add":
        {
            string name = charXml.Attributes["name"].Value;
            int    pos  = int.Parse(charXml.Attributes["pos"].Value) - 1;
            srp.Characters.AddCharacterToTheScene(type, name, pos);
            break;
        }

        case "apply":
        {
            string name = charXml.Attributes["name"].Value;
            int    pos  = int.Parse(charXml.Attributes["pos"].Value) - 1;
            srp.Characters.ApplyCharacterToTheScene(type, name, pos);
            break;
        }

        case "rem":
        {
            string[] types = type.Split(',');
            string[] dir   = charXml.Attributes["dir"].Value.Split(',');
            int[]    pos   = minusOne(charXml.Attributes["pos"].Value);
            srp.Characters.RemoveTheCharacterFromTheScene(types, dir, pos);
            break;
        }

        case "move":
        {
            string dir = charXml.Attributes["dir"].Value;
            int    pos = int.Parse(charXml.Attributes["pos"].Value) - 1;
            srp.Characters.MoveCharacterToTheScene(type, dir, pos);
            break;
        }

        case "flinch":
        {
            string[] dir = charXml.Attributes["dir"].Value.Split(',');
            int[]    pos = minusOne(charXml.Attributes["pos"].Value);
            srp.Characters.FlinchCharacterToTheScene(type, dir, pos);
            break;
        }
        }
    }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Zero != null ? Zero.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (One != null ? One.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MinusOne != null ? MinusOne.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ParameterName != null ? ParameterName.GetHashCode() : 0);
         return(hashCode);
     }
 }
 public IAnimatedBehavior Remapping(Dictionary <QualifiedAnimation, AnimationClip> remapping, Dictionary <BlendTree, BlendTree> blendRemapping)
 {
     return(new TwoDirectionsMassiveBlendAnimatedBehavior(Zero.Remapping(remapping, blendRemapping), One.Remapping(remapping, blendRemapping), MinusOne.Remapping(remapping, blendRemapping), ParameterName));
 }