예제 #1
0
        private static LinkDef[] CreateLinkDef(params object[] def)
        {
            if ((def.Length & 1) != 0)
            {
                throw new Exception("Invalid definition");
            }

            var a = new LinkDef[def.Length >> 1];

            for (int i = 0; i < def.Length; i += 2)
            {
                if (def[i] is Clay)
                {
                    a[i >> 1] = new LinkDef((Clay)def[i], def[i + 1]);
                }
                else
                {
                    throw new Exception("Invalid definition");
                }
            }

            return(a);
        }
예제 #2
0
 public void Link(LinkDef def)
 {
     Clay.Connect(this, def.Clay, def.ConnectPoint, def.ConnectPoint);
 }