40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Code.Calendar.DataStructures
|
|
{
|
|
public struct Plant : IEquatable<Plant>
|
|
{
|
|
public string Name;
|
|
public string IconPath;
|
|
public Guid Id;
|
|
|
|
public bool Equals(Plant other) => Id == other.Id;
|
|
|
|
public override bool Equals(object obj) => obj is Plant other && Equals(other);
|
|
|
|
public override int GetHashCode() => Id.GetHashCode();
|
|
}
|
|
public struct Task : IEquatable<Task>
|
|
{
|
|
public Guid Id;
|
|
|
|
public bool Active;
|
|
|
|
public string Description;
|
|
public DateTime Date; // Если периодичная, то дата первого мероприятия
|
|
|
|
public bool IsPeriodic;
|
|
public int PeriodicInterval;
|
|
public DateTime PeriodicUntil;
|
|
|
|
public Guid PlantId;
|
|
public List<string> PhotoPaths;
|
|
|
|
public bool Equals(Task other) => Id == other.Id;
|
|
|
|
public override bool Equals(object obj) => obj is Task other && Equals(other);
|
|
|
|
public override int GetHashCode() => Id.GetHashCode();
|
|
}
|
|
} |