Umstrukturierung
This commit is contained in:
42
ReallifeGamemode.Database/Entities/ATM.cs
Normal file
42
ReallifeGamemode.Database/Entities/ATM.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Entities ATM (ATM.cs)
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
public class ATM : IBankAccountOwner, IBankAccount
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int Balance { get; set; }
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
public float Z { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public Vector3 Position => new Vector3(X, Y, Z);
|
||||
|
||||
public bool Faulty { get; set; } = false;
|
||||
public bool Active { get; set; } = true;
|
||||
|
||||
public string Name => throw new NotImplementedException();
|
||||
|
||||
public IBankAccount GetBankAccount(DatabaseContext databaseContext = null)
|
||||
{
|
||||
databaseContext = databaseContext ?? new DatabaseContext();
|
||||
return databaseContext.ATMs.Where(a => a.Id == this.Id).First();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user