Inheritance: FBLibrary.Core.BaseEntities.BasePowerUp
Beispiel #1
0
        private void RemovePowerUp(PowerUp powerUp)
        {
            _powerUpList.Remove(powerUp);

            base.RemovePowerUp(powerUp);

            Program.Log.Info("Power up at " + powerUp.CellPosition + " has been removed.");
        }
        public void SendPowerUpPickUp(Client client, PowerUp powerUp)
        {
            NetOutgoingMessage message = _server.CreateMessage();

            message.Write((byte)MessageType.ServerMessage.PowerUpPickUp);

            message.Write(client.ClientId);
            message.Write(powerUp.CellPosition);
            message.Write((byte)powerUp.Type);

            _server.SendToAll(message, NetDeliveryMethod.ReliableOrdered);

            Program.Log.Info("[SENT] Power up pick up by client #" + client.ClientId + " ! (type: " + powerUp.Type + "|position: " + powerUp.CellPosition + ")");
        }
Beispiel #3
0
        public override void AddPowerUp(Point position)
        {
            var powerUp = new PowerUp(position);
            _powerUpList.Add(powerUp);

            GameServer.Instance.SendPowerUpDrop(powerUp);

            base.AddPowerUp(powerUp);
        }
        public void SendPowerUpDrop(PowerUp powerUp)
        {
            NetOutgoingMessage message = _server.CreateMessage();

            message.Write((byte)MessageType.ServerMessage.PowerUpDrop);

            message.Write((byte)powerUp.Type);
            message.Write(powerUp.CellPosition);

            _server.SendToAll(message, NetDeliveryMethod.ReliableOrdered);

            Program.Log.Info("[SEND] Power up dropped ! (type: " + powerUp.Type + "|position: " + powerUp.CellPosition + ")");
        }