Esempio n. 1
0
        private void ProcessUpdateWing(ANWI.Messaging.IMessagePayload p)
        {
            ANWI.Messaging.Ops.UpdateWing upw
                = p as ANWI.Messaging.Ops.UpdateWing;

            switch (upw.type)
            {
            case ANWI.Messaging.Ops.UpdateWing.Type.SetName:
                fleet.SetWingName(upw.wingUUID, upw.str);
                break;

            case ANWI.Messaging.Ops.UpdateWing.Type.SetCallsign:
                fleet.SetWingCallsign(upw.wingUUID, upw.str);
                break;

            case ANWI.Messaging.Ops.UpdateWing.Type.ChangeWingCommander:
                fleet.SetWingCommander(upw.boatUUID);
                break;

            case ANWI.Messaging.Ops.UpdateWing.Type.ChangeRole:
                fleet.ChangeWingRole(upw.wingUUID, (Wing.Role)upw.integer);
                break;
            }

            RebuildC2();

            NotifyPropertyChanged(string.Empty);
        }
Esempio n. 2
0
        public void ModifyUnit(ANWI.Messaging.Ops.ModifyUnit mod)
        {
            switch (mod.type)
            {
            case ANWI.Messaging.Ops.ModifyUnit.ChangeType.SetFlagship:
                fleet.SetFlagship(mod.unitUUID);
                PushToAll(new ANWI.Messaging.Ops.UpdateShip()
                {
                    shipUUID = mod.unitUUID,
                    type     = ANWI.Messaging.Ops.UpdateShip.Type.SetFlagship
                });
                break;

            case ANWI.Messaging.Ops.ModifyUnit.ChangeType.SetWingCommander:
                fleet.SetWingCommander(mod.unitUUID);
                PushToAll(new ANWI.Messaging.Ops.UpdateWing()
                {
                    type     = ANWI.Messaging.Ops.UpdateWing.Type.ChangeWingCommander,
                    boatUUID = mod.unitUUID
                });
                break;

            case ANWI.Messaging.Ops.ModifyUnit.ChangeType.ChangeName:
                fleet.SetWingName(mod.unitUUID, mod.str);
                PushToAll(new ANWI.Messaging.Ops.UpdateWing()
                {
                    wingUUID = mod.unitUUID,
                    type     = ANWI.Messaging.Ops.UpdateWing.Type.SetName,
                    str      = mod.str
                });
                break;

            case ANWI.Messaging.Ops.ModifyUnit.ChangeType.ChangeCallsign:
                fleet.SetWingCallsign(mod.unitUUID, mod.str);
                PushToAll(new ANWI.Messaging.Ops.UpdateWing()
                {
                    wingUUID = mod.unitUUID,
                    type     = ANWI.Messaging.Ops.UpdateWing.Type.SetCallsign,
                    str      = mod.str
                });
                break;

            case ANWI.Messaging.Ops.ModifyUnit.ChangeType.ChangeWingRole:
                fleet.ChangeWingRole(mod.unitUUID, (Wing.Role)mod.integer);
                PushToAll(new ANWI.Messaging.Ops.UpdateWing()
                {
                    wingUUID = mod.unitUUID,
                    type     = ANWI.Messaging.Ops.UpdateWing.Type.ChangeRole,
                    integer  = mod.integer
                });
                break;
            }
        }