private void OnFixedBall(MsgBase b) { var selfMsg = (Msg_AgarFixedBall)b; uint id = selfMsg.BallId; if (selfMsg.Operat == Msg_AgarFixedBall.Add) { var food = new DefaultFoodCircle( new Vector2(selfMsg.X, selfMsg.Y), selfMsg.Radius, selfMsg.Color); FoodList[id] = food; this.AddChind(food, FoodZOrder); } else if (selfMsg.Operat == Msg_AgarFixedBall.Remove) { CozyCircle food = FoodList[id]; this.RemoveChild(food); FoodList.Remove(id); } }
private void OnFixBallPack(MsgBase b) { var selfMsg = (Msg_AgarFixBallPack)b; foreach (var obj in selfMsg.FixedList) { uint fid = obj.Item1; var food = new DefaultFoodCircle(new Vector2(obj.Item2, obj.Item3), obj.Item4, obj.Item5); FoodList[fid] = food; this.AddChind(food, FoodZOrder); } }