refactor: MonoGameCamera
This commit is contained in:
parent
3717701171
commit
958a75552f
|
@ -1,5 +1,3 @@
|
|||
using System;
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
|
@ -10,11 +8,11 @@ namespace Pong.Behaviours;
|
|||
|
||||
public class MonoGameCameraBehaviour : BehaviourOverride
|
||||
{
|
||||
public Action<MonoGameCameraBehaviour>? OnPositionChanged { get; set; } = null;
|
||||
public Action<MonoGameCameraBehaviour>? OnMatrixTransformChanged { get; set; } = null;
|
||||
public Action<MonoGameCameraBehaviour>? OnViewportChanged { get; set; } = null;
|
||||
public Action<MonoGameCameraBehaviour>? OnRotationChanged { get; set; } = null;
|
||||
public Action<MonoGameCameraBehaviour>? OnZoomChanged { get; set; } = null;
|
||||
public System.Action<MonoGameCameraBehaviour>? OnPositionChanged { get; set; } = null;
|
||||
public System.Action<MonoGameCameraBehaviour>? OnMatrixTransformChanged { get; set; } = null;
|
||||
public System.Action<MonoGameCameraBehaviour>? OnViewportChanged { get; set; } = null;
|
||||
public System.Action<MonoGameCameraBehaviour>? OnRotationChanged { get; set; } = null;
|
||||
public System.Action<MonoGameCameraBehaviour>? OnZoomChanged { get; set; } = null;
|
||||
|
||||
private Matrix _matrixTransform = Matrix.Identity;
|
||||
|
||||
|
@ -59,7 +57,7 @@ public class MonoGameCameraBehaviour : BehaviourOverride
|
|||
get => _zoom;
|
||||
set
|
||||
{
|
||||
float newValue = value >= .1f ? value : .1f;
|
||||
float newValue = Math.Max(0.1f, value);
|
||||
|
||||
if (_zoom == newValue)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue