コード例 #1
0
ファイル: Beacon.cs プロジェクト: 12urenloop/TelraamSim
        // Called every frame. 'delta' is the elapsed time since the previous frame.
        public override void _Process(float delta)
        {
            time += delta;
            var areas = area2D.GetOverlappingAreas();

            if (areas.Count <= 0)
            {
                return;
            }
            foreach (Area2D area in areas)
            {
                var batonId = area.GetOwner <Baton>().batonId;
                if (JsonLogger.GetInstance().Recording)
                {
                    var detection = new Detection(batonId, BeaconId, (int)(time * 1000));
                    JsonLogger.GetInstance().LogDetection(detection);
                    var buf = $"{beaconId},{(int)(time*1000)},{batonId},IGNORE\n".ToUTF8();
                    tcpClient.GetStream().Write(buf, 0, buf.Length);
                }
            }
        }
コード例 #2
0
ファイル: JsonLogger.cs プロジェクト: 12urenloop/TelraamSim
 public void LogDetection(Detection detection)
 {
     detections.Add(detection);
 }