27 lines
519 B
C#
27 lines
519 B
C#
|
using System;
|
||
|
using Microsoft.Xna.Framework;
|
||
|
using Syntriax.Engine.Core;
|
||
|
|
||
|
namespace Pong.Behaviours;
|
||
|
|
||
|
public class PlayAreaBehaviour : BehaviourOverride
|
||
|
{
|
||
|
public Action<PlayAreaBehaviour>? OnPlayAreaChanged { get; set; } = null;
|
||
|
|
||
|
private Vector2 _playArea = Vector2.Zero;
|
||
|
|
||
|
public Vector2 PlayArea
|
||
|
{
|
||
|
get => _playArea;
|
||
|
set
|
||
|
{
|
||
|
if (_playArea == value)
|
||
|
return;
|
||
|
|
||
|
_playArea = value;
|
||
|
OnPlayAreaChanged?.Invoke(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|