Exemple #1
0
 public void botUpdate(BugBot bot, int index, Vector3 newDirection)
 {
     writer.Write((byte)MessageType.BotUpdate);
     //Write bot ID
     writer.Write((int)bot.npcID);
     //Write index of vector update
     writer.Write((int)index);
     //Write vector update
     writer.Write(newDirection);
 }
Exemple #2
0
        private void readBotUpdate()
        {
            //Read bot ID
            int botID = reader.ReadInt32();
            //Read index of vector update
            int     index  = reader.ReadInt32();
            Vector3 newDir = reader.ReadVector3();
            //Read vector update

            BugBot leBot = null;

            foreach (BugBot bot in Global.bugBots)
            {
                if (bot.npcID == botID)
                {
                    leBot = bot;
                    break;
                }
            }
            if (leBot != null)
            {
                leBot.movePoint(index, newDir);
            }
        }