示例#1
0
        public FieldInfo(rlbot.flat.FieldInfo fieldInfo)
        {
            Goals     = new GoalInfo[fieldInfo.GoalsLength];
            BoostPads = new BoostPad[fieldInfo.BoostPadsLength];

            for (int i = 0; i < fieldInfo.GoalsLength; i++)
            {
                Goals[i] = new GoalInfo(fieldInfo.Goals(i).Value);
            }

            for (int i = 0; i < fieldInfo.BoostPadsLength; i++)
            {
                BoostPads[i] = new BoostPad(fieldInfo.BoostPads(i).Value);
            }
        }
示例#2
0
        /// <summary>
        /// Updates the fields of this object to reflect a new fieldinfo flatbuffers object.
        /// </summary>
        /// <param name="fieldInfo"></param>
        public void Update(rlbot.flat.FieldInfo fieldInfo)
        {
            boostPads = new BoostPad[fieldInfo.BoostPadsLength];

            for (int i = 0; i < boostPads.Length; i++)
            {
                boostPads[i] = new BoostPad(fieldInfo.BoostPads(i).Value);
            }

            goals = new Goal[fieldInfo.GoalsLength];

            for (int i = 0; i < goals.Length; i++)
            {
                goals[i] = new Goal(fieldInfo.Goals(i).Value);
            }
        }