- DroneType 枚举清理:移除 Electric/Piston,重编号 HighSpeed=2 - planner_config.json / defaults.json 同步迁移 - 238 单元测试全部通过
28 lines
770 B
C#
28 lines
770 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using CounterDrone.Core.Models;
|
|
using SQLite;
|
|
|
|
namespace CounterDrone.Core.Repository
|
|
{
|
|
public class ControlZoneRepository : BaseRepository<ControlZone>
|
|
{
|
|
public ControlZoneRepository(SQLiteConnection db) : base(db) { }
|
|
|
|
public List<ControlZone> GetByScenarioId(string scenarioId)
|
|
{
|
|
return Db.Table<ControlZone>()
|
|
.Where(z => z.ScenarioId == scenarioId)
|
|
.OrderBy(z => z.OrderIndex)
|
|
.ToList();
|
|
}
|
|
|
|
public void DeleteByScenarioId(string scenarioId)
|
|
{
|
|
var zones = GetByScenarioId(scenarioId);
|
|
foreach (var z in zones)
|
|
Db.Delete(z);
|
|
}
|
|
}
|
|
}
|