76 lines
2.2 KiB
C#
76 lines
2.2 KiB
C#
using Manager.DTOs;
|
|
using ManagerService.DTOs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
|
|
|
|
namespace ManagerService.Data.SubSection
|
|
{
|
|
/// <summary>
|
|
/// Section game
|
|
/// </summary>
|
|
public class SectionGame : Section
|
|
{
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> GameMessageDebut { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> GameMessageFin { get; set; }
|
|
|
|
public string GamePuzzleImageId { get; set; } // But only image is possible
|
|
public Resource GamePuzzleImage { get; set; } // But only image is possible
|
|
|
|
[Required]
|
|
public int GamePuzzleRows { get; set; } = 3;
|
|
|
|
[Required]
|
|
public int GamePuzzleCols { get; set; } = 3;
|
|
|
|
public GameTypes GameType { get; set; } = GameTypes.Puzzle;
|
|
|
|
public GameDTO ToDTO()
|
|
{
|
|
return new GameDTO()
|
|
{
|
|
id = Id,
|
|
label = Label,
|
|
title = Title.ToList(),
|
|
description = Description.ToList(),
|
|
order = Order,
|
|
type = Type,
|
|
imageId = ImageId,
|
|
imageSource = ImageSource,
|
|
configurationId = ConfigurationId,
|
|
isSubSection = IsSubSection,
|
|
parentId = ParentId,
|
|
dateCreation = DateCreation,
|
|
instanceId = InstanceId,
|
|
isBeacon = IsBeacon,
|
|
beaconId = BeaconId,
|
|
latitude = Latitude,
|
|
longitude = Longitude,
|
|
meterZoneGPS = MeterZoneGPS,
|
|
messageDebut = GameMessageDebut,
|
|
messageFin = GameMessageFin,
|
|
puzzleImage = GamePuzzleImage.ToDTO(),
|
|
puzzleImageId = GamePuzzleImageId,
|
|
rows = GamePuzzleRows,
|
|
cols = GamePuzzleCols,
|
|
gameType = GameType
|
|
};
|
|
}
|
|
|
|
public enum GameTypes
|
|
{
|
|
Puzzle,
|
|
SlidingPuzzle,
|
|
Escape
|
|
}
|
|
}
|
|
}
|