#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
58
Scripts/Items/Games/Mahjong/MahjongWallBreakIndicator.cs
Normal file
58
Scripts/Items/Games/Mahjong/MahjongWallBreakIndicator.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Engines.Mahjong
|
||||
{
|
||||
public class MahjongWallBreakIndicator
|
||||
{
|
||||
public static MahjongPieceDim GetDimensions( Point2D position )
|
||||
{
|
||||
return new MahjongPieceDim( position, 20, 20 );
|
||||
}
|
||||
|
||||
private MahjongGame m_Game;
|
||||
private Point2D m_Position;
|
||||
|
||||
public MahjongGame Game { get { return m_Game; } }
|
||||
public Point2D Position { get { return m_Position; } }
|
||||
|
||||
public MahjongWallBreakIndicator( MahjongGame game, Point2D position )
|
||||
{
|
||||
m_Game = game;
|
||||
m_Position = position;
|
||||
}
|
||||
|
||||
public MahjongPieceDim Dimensions
|
||||
{
|
||||
get { return GetDimensions( m_Position ); }
|
||||
}
|
||||
|
||||
public void Move( Point2D position )
|
||||
{
|
||||
MahjongPieceDim dim = GetDimensions( position );
|
||||
|
||||
if ( !dim.IsValid() )
|
||||
return;
|
||||
|
||||
m_Position = position;
|
||||
|
||||
m_Game.Players.SendGeneralPacket( true, true );
|
||||
}
|
||||
|
||||
public void Save( GenericWriter writer )
|
||||
{
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Position );
|
||||
}
|
||||
|
||||
public MahjongWallBreakIndicator( MahjongGame game, GenericReader reader )
|
||||
{
|
||||
m_Game = game;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Position = reader.ReadPoint2D();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue