예제 #1
0
        public override void onAdd(BlockSymbol blockSymbol, Client client)
        {
            APlay.Common.Logging.Logger.LogDesigned(2, "OnAdd(blockSymbol) Pos: " + blockSymbol.PositionX + "/" + blockSymbol.PositionY, "AplayTest.Server.Sheet");

            var undoObject = new BlockSymbolUndoable(blockSymbol);

            _undoService.AddInsert(Id, undoObject, BlockSymbols.Count, "Adding new Block", client.Id);

            BlockSymbols.Add(blockSymbol);
        }
예제 #2
0
        public override void onSetPosition(AplayPoint position__, Client client__)
        {
            if (Math.Abs(PositionX - position__.X) < double.Epsilon && Math.Abs(PositionY - position__.Y) < double.Epsilon)
            {
                return;
            }

            var oldState = new BlockSymbolUndoable(Id, PositionX, PositionY);

            PositionX = position__.X;
            PositionY = position__.Y;

            _undoService.AddUpdate(oldState, new BlockSymbolUndoable(this), "Position of block changed", client__.Id);
        }