コード例 #1
0
        IList <Thing> processSensoryInformation()
        {
            IList <Thing> response = null;

            if (worldServer != null && worldServer.IsConnected)
            {
                response = worldServer.SendGetCreatureState(creatureName);
                //if(leaflet1.leafletID==0 && leaflet2.leafletID==0 && leaflet3.leafletID == 0) {
                //	Creature cc = (Creature)response [0];
                //	leaflet1.leafletID = cc.leaflets [0].leafletID;
                //	leaflet2.leafletID = cc.leaflets [1].leafletID;
                //	leaflet3.leafletID = cc.leaflets [2].leafletID;
                //	Console.WriteLine ("Creature found: " + cc.Name);
                //	Console.WriteLine ("LF1: " + cc.leaflets [0].leafletID);
                //	Console.WriteLine ("LF2: " + cc.leaflets [1].leafletID);
                //	Console.WriteLine ("LF3: " + cc.leaflets [2].leafletID);
                //}

                prad = (Math.PI / 180) * response.First().Pitch;
                while (prad > Math.PI)
                {
                    prad -= 2 * Math.PI;
                }
                while (prad < -Math.PI)
                {
                    prad += 2 * Math.PI;
                }
                Sack s = worldServer.SendGetSack(creatureId);
                mind.setBag(s);
            }

            return(response);
        }
コード例 #2
0
        IList <Thing> processSensoryInformation()
        {
            IList <Thing> response = null;

            if (worldServer != null && worldServer.IsConnected)
            {
                response = worldServer.SendGetCreatureState(creatureName);
                prad     = (Math.PI / 180) * response.First().Pitch;
                while (prad > Math.PI)
                {
                    prad -= 2 * Math.PI;
                }
                while (prad < -Math.PI)
                {
                    prad += 2 * Math.PI;
                }
                Sack s = worldServer.SendGetSack("0");
                mind.setBag(s);
            }

            return(response);
        }