/// <summary> /// Is this art valid to be used at the moment /// </summary> /// <param name="actor">who's doing the hitting</param> /// <param name="victim">who's being hit</param> /// <returns>yea or nay</returns> public bool IsValid(IMobile actor, IMobile victim, ulong distance, IFightingArt lastAttack = null) { return(distance.IsBetweenOrEqual(DistanceRange.Low, DistanceRange.High) && actor.CurrentHealth >= Health.Actor && actor.CurrentStamina >= Stamina.Actor && (lastAttack == null || (lastAttack.RekkaKey.Equals(RekkaKey) && lastAttack.RekkaPosition == RekkaPosition - 1))); }
/// <summary> /// Execute a sale /// </summary> /// <param name="item">the item in question</param> /// <param name="price">the sale price</param> /// <returns>error or blank</returns> public string Instruct(IMobile customer, string qualityName, int level, int price) { string returnString = string.Empty; if (customer == null) { return("Invalid customer"); } IQuality quality = TeachableProficencies.FirstOrDefault(qual => qual.Name.Equals(qualityName, StringComparison.InvariantCultureIgnoreCase) && qual.Value > level); if (quality == null) { return("I can't teach that proficency to you."); } int customerWallet = customer.GetQuality("Bells"); if (customerWallet < price) { return("Insufficient Funds."); } customer.SetQuality(-1 * price, "Bells", true); customer.SetQuality(1, quality.Name, true); return(returnString); }
static void Main(string[] args) { IMobile mobile = MobileFactory.CreateMobile(BrandType.Apple); mobile.GetMobile(); Console.ReadKey(); }
public void RemoveMobileObject(IMobile toRemove) { if (_objectsToMove.Contains(toRemove)) { _objectsToMove.Remove(toRemove); } }
/// <summary> /// Execute a sale /// </summary> /// <param name="item">the item in question</param> /// <param name="price">the sale price</param> /// <returns>error or blank</returns> public string MakeSale(IMobile customer, IInanimate item, int price) { string returnString = string.Empty; if (customer == null) { return("Invalid customer"); } if (item == null || !Inventory.Contains(item)) { return("I don't have that item in stock."); } int customerWallet = customer.GetQuality("Bells"); if (customerWallet < price) { return("Insufficient Funds."); } customer.SetQuality(-1 * price, "Bells", true); item.TryMoveTo(customer.GetContainerAsLocation()); return(returnString); }
/// <summary> /// Executes this command /// </summary> internal override bool ExecutionBody() { List<string> sb = new List<string>(); IMobile chr = (IMobile)Actor; List<ILexicalParagraph> toActor = new List<ILexicalParagraph> { new LexicalParagraph("You look through your belongings.") }; foreach (IInanimate thing in chr.Inventory.EntitiesContained()) { toActor.Add(thing.RenderAsContents(chr, new[] { MessagingType.Visible })); } ILexicalParagraph toOrigin = new LexicalParagraph("$A$ sifts through $G$ belongings."); Message messagingObject = new Message(toActor) { ToOrigin = new List<ILexicalParagraph> { toOrigin } }; messagingObject.ExecuteMessaging(Actor, null, null, OriginLocation.CurrentRoom, null); return true; }
static void Main(string[] args) { IMobile samsung = FactoryClass.CreateMobileObject(MobileType.Samsung); Console.WriteLine(samsung.ModelName()); Console.ReadKey(); }
public static void ProcessArena1(IMobile mobile) { Point3D doorLocation = mobile.Location; mobile.Map.OpenDoor(mobile, doorLocation); //mobile.Health -= 10; }
public static AggressorInfo Create(IMobile attacker, IMobile defender, bool criminal) { AggressorInfo info; if (m_Pool.Count > 0) { info = m_Pool.Dequeue(); info.m_Attacker = attacker; info.m_Defender = defender; info.m_CanReportMurder = criminal; info.m_CriminalAggression = criminal; info.m_Queued = false; info.Refresh(); } else { info = new AggressorInfo(attacker, defender, criminal); } return(info); }
public async void SetSleepClicked() { Config config = new Config(); config.sleep_mode = 1; config.request = "set"; config.info = "config"; var deviceRes = await deviceService.SetDeviceConfig(config); Device.BeginInvokeOnMainThread(async() => { try { using (UserDialogs.Instance.Loading("Closing app...")) { await Task.Delay(1000 * 3); UserDialogs.Instance.HideLoading(); IMobile mobile = DependencyService.Get <IMobile>(); mobile.TerminateApp(); } } catch (Exception ex) { var val = ex.Message; } }); }
public static void Main(string[] args) { IMobileFactory mobileFactory = new XiaomiFactory(); IMobile mobile = mobileFactory.GetMobile(ModelType.RedmiPro); mobile.GetMobile(); }
public void AddMobileObject(IMobile toAdd) { if (!_objectsToMove.Contains(toAdd)) { _objectsToMove.Add(toAdd); } }
static void Main(string[] args) { var mobileRepository = new MobileRepository(); IMobile mobile = mobileRepository.GetMobileByName("samsungnn"); mobile.TurnOn(); mobile.TurnOff(); }
public AboutPage() { InitializeComponent(); IMobile mobile = DependencyService.Get <IMobile>(); versionLbl.Text = mobile.GetVersion(); getFWversion(); }
static void Main(string[] args) { IMobileFactory mobileFactory = new AppleFactory(); IMobile mobile = mobileFactory.GetMobile(ModelTypes.AppleIphone12); mobile.GetMobile(); Console.ReadKey(); }
public IMobile Update(IMobile mobile) { var oldMobile = GetById(mobile.Id); var index = _repository.IndexOf(oldMobile); _repository[index] = mobile; return(_repository[index]); }
public static void ProcessDoorValour5(IMobile mobile) { Point3D doorLocation = new Point3D(406, 80, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(406, 81, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(406, 82, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
public static void Log(string str, bool printConsole = true) { IMobile mobile = DependencyService.Get <IMobile>(); if (printConsole) { Console.WriteLine(str); } mobile.Log(str); }
public static void ProcessDoorValour8(IMobile mobile) { Point3D doorLocation = new Point3D(277, 91, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(277, 92, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(277, 93, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
private AggressorInfo(IMobile attacker, IMobile defender, bool criminal) { m_Attacker = attacker; m_Defender = defender; m_CanReportMurder = criminal; m_CriminalAggression = criminal; Refresh(); }
public static void ProcessDoorValour1(IMobile mobile) { Point3D doorLocation = new Point3D(315, 177, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(316, 177, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(317, 177, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
public static void ProcessDoorValour3(IMobile mobile) { Point3D doorLocation = new Point3D(387, 174, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(388, 174, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(389, 174, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
public static void ProcessDoorValour6(IMobile mobile) { Point3D doorLocation = new Point3D(371, 45, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(372, 45, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(373, 45, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
public static void ProcessDoorValour4(IMobile mobile) { Point3D doorLocation = new Point3D(406, 127, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(406, 128, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(406, 129, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
public static void ProcessDoorValour7(IMobile mobile) { Point3D doorLocation = new Point3D(294, 45, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(295, 45, 0); mobile.Map.OpenDoor(mobile, doorLocation); doorLocation = new Point3D(296, 45, 0); mobile.Map.OpenDoor(mobile, doorLocation); }
public void Interract(IMobile from, IOwnable to) { if (to.Disable) { return; } else { to.SetOwnerID(from.GetOwnerID()); } }
public override void Write(IMobile value) { if (value == null || value.Deleted) { Write(Serial.MinusOne); } else { Write(value.Serial); } }
public void GetDoorStatus(IMobile mobile, Point3D location) { if (mapData[location.X, location.Y].Length < location.Z) { return; } //Set all doors to open... MapData md = mapData[location.X, location.Y][location.Z]; mobile.PlayerSocket.Send(new DoorStatusPacket(this, location, md.DoorStatus)); }
public static void InteractNPC(PlayerSocket socket, Packet packet) { int mobileID = packet.ReadInt16(); IMap map = socket.Mobile.Map; IMobile mob = map.GetMobile(mobileID); if (mob != null) { socket.Mobile.InteractNPC(mob); } }
public static void DialogInteract(PlayerSocket socket, Packet packet) { int mobileID = packet.ReadInt16(); byte buttonID = packet.ReadByte(); IMobile mob = socket.Mobile.Map.GetMobile(mobileID); if (mob != null) { socket.Mobile.InteractDialog(mob, buttonID); } }
public USBMountingState(IMobile aMobile) { myMobile = aMobile; }
public AdbState(IMobile aMobile) { myMobile = aMobile; }
public ChargingState(IMobile aMobile) { myMobile = aMobile; }