mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-07 23:20:27 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
83
server/tso.common/Rendering/Framework/3DAbstract.cs
Executable file
83
server/tso.common/Rendering/Framework/3DAbstract.cs
Executable file
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using FSO.Common.Rendering.Framework.Camera;
|
||||
using FSO.Common.Rendering.Framework.Model;
|
||||
|
||||
namespace FSO.Common.Rendering.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for scenes with 3D elements.
|
||||
/// </summary>
|
||||
public abstract class _3DAbstract : IDisposable
|
||||
{
|
||||
public ICamera Camera;
|
||||
public string ID;
|
||||
public bool Visible = true;
|
||||
public abstract List<_3DComponent> GetElements();
|
||||
public abstract void Add(_3DComponent item);
|
||||
public abstract void Update(UpdateState Time);
|
||||
public abstract void Draw(GraphicsDevice device);
|
||||
|
||||
protected _3DLayer Parent;
|
||||
private EventHandler<EventArgs> ResetEvent;
|
||||
|
||||
public virtual void PreDraw(GraphicsDevice device)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Initialize(_3DLayer layer)
|
||||
{
|
||||
Parent = layer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new _3DAbstract instance.
|
||||
/// </summary>
|
||||
/// <param name="Device">A GraphicsDevice instance.</param>
|
||||
public _3DAbstract(GraphicsDevice Device)
|
||||
{
|
||||
m_Device = Device;
|
||||
ResetEvent = new EventHandler<EventArgs>(m_Device_DeviceReset);
|
||||
m_Device.DeviceReset += ResetEvent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when m_Device is reset.
|
||||
/// </summary>
|
||||
private void m_Device_DeviceReset(object sender, EventArgs e)
|
||||
{
|
||||
DeviceReset(m_Device);
|
||||
}
|
||||
|
||||
protected GraphicsDevice m_Device;
|
||||
|
||||
public abstract void DeviceReset(GraphicsDevice Device);
|
||||
public static bool IsInvalidated;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public object Controller { get; internal set; }
|
||||
|
||||
public void SetController(object controller)
|
||||
{
|
||||
this.Controller = controller;
|
||||
}
|
||||
|
||||
public T FindController<T>()
|
||||
{
|
||||
if(Controller is T)
|
||||
{
|
||||
return (T)Controller;
|
||||
}
|
||||
return default(T);
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (m_Device != null) m_Device.DeviceReset -= ResetEvent;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue