/// <summary> /// Function to transform goal data into the desired format for firestore. /// </summary> /// <returns></returns> public Dictionary <string, object> ToDict() { var values = new Dictionary <string, object> { { "session_id", matchData.SessionId }, { "match_time", matchData.MatchTimeSQL }, { "game_clock", GameClock }, { "player_id", Player.userid }, { "player_name", Player.name }, { "point_value", LastScore.point_amount }, { "disc_speed", LastScore.disc_speed }, { "goal_distance", LastScore.distance_thrown }, { "assist_name", LastScore.assist_scored }, { "goal_type", LastScore.goal_type }, { "team_scored", LastScore.team }, { "goal_pos_x", GoalPos.X }, { "goal_pos_y", GoalPos.Y }, { "pos_x", Position.X }, { "pos_y", Position.Y }, { "pos_z", Position.Z }, { "goal_angle", GoalAngle }, { "backboard", Backboard }, { "goal_color", GoalColor.ToString() }, { "left_handed", LeftHanded }, { "underhandedness", underhandedness }, //{"trajectory", TrajectoryJSON } // TODO this is causing problems with json serialization of the rest of the data }; return(values); }
internal void Load(EndianBinaryReader input) { Position = new Vector3(input.ReadSingle(), input.ReadSingle(), input.ReadSingle()); // The rotation is stored as a 16-bit unsigned integer, where the full range // represents a full rotation Rotation = new Vector3( (float)input.ReadUInt16() / 0x10000, (float)input.ReadUInt16() / 0x10000, (float)input.ReadUInt16() / 0x10000); ushort goalColorInt = input.ReadUInt16(); if (!Enum.IsDefined(typeof(GoalColor), goalColorInt)) { throw new InvalidStageLayoutFileException("Unknown StageLayoutGoal[0x12]."); } Color = (GoalColor)goalColorInt; }
// Callback with color of goal that was scored on public void OnGoalScored(GoalColor color) { if (color == GoalColor.Blue) { // If we scored on the blue goal, add one to orange's score. m_OrangeScoreValue++; m_OrangeScore.text = string.Format("{0}", m_OrangeScoreValue); } else if (color == GoalColor.Orange) { m_BlueScoreValue++; m_BlueScore.text = string.Format("{0}", m_BlueScoreValue); } else { Debug.Assert(false, "Unknown goal color!"); } }
public StageLayoutGoal() { Position = Vector3.Zero; Rotation = Vector3.Zero; Color = GoalColor.Blue; }