コード例 #1
0
 /// <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)));
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            IMobile mobile = MobileFactory.CreateMobile(BrandType.Apple);

            mobile.GetMobile();
            Console.ReadKey();
        }
コード例 #4
0
 public void RemoveMobileObject(IMobile toRemove)
 {
     if (_objectsToMove.Contains(toRemove))
     {
         _objectsToMove.Remove(toRemove);
     }
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        /// <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;
        }
コード例 #7
0
        static void Main(string[] args)
        {
            IMobile samsung = FactoryClass.CreateMobileObject(MobileType.Samsung);

            Console.WriteLine(samsung.ModelName());
            Console.ReadKey();
        }
コード例 #8
0
        public static void ProcessArena1(IMobile mobile)
        {
            Point3D doorLocation = mobile.Location;

            mobile.Map.OpenDoor(mobile, doorLocation);
            //mobile.Health -= 10;
        }
コード例 #9
0
ファイル: AggressorInfo.cs プロジェクト: nydehi/divinity
        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);
        }
コード例 #10
0
        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;
                }
            });
        }
コード例 #11
0
        public static void Main(string[] args)
        {
            IMobileFactory mobileFactory = new XiaomiFactory();
            IMobile        mobile        = mobileFactory.GetMobile(ModelType.RedmiPro);

            mobile.GetMobile();
        }
コード例 #12
0
 public void AddMobileObject(IMobile toAdd)
 {
     if (!_objectsToMove.Contains(toAdd))
     {
         _objectsToMove.Add(toAdd);
     }
 }
コード例 #13
0
        static void Main(string[] args)
        {
            var     mobileRepository = new MobileRepository();
            IMobile mobile           = mobileRepository.GetMobileByName("samsungnn");

            mobile.TurnOn();
            mobile.TurnOff();
        }
コード例 #14
0
ファイル: AboutPage.xaml.cs プロジェクト: 007vel/Terra
        public AboutPage()
        {
            InitializeComponent();
            IMobile mobile = DependencyService.Get <IMobile>();

            versionLbl.Text = mobile.GetVersion();
            getFWversion();
        }
コード例 #15
0
        static void Main(string[] args)
        {
            IMobileFactory mobileFactory = new AppleFactory();
            IMobile        mobile        = mobileFactory.GetMobile(ModelTypes.AppleIphone12);

            mobile.GetMobile();
            Console.ReadKey();
        }
コード例 #16
0
        public IMobile Update(IMobile mobile)
        {
            var oldMobile = GetById(mobile.Id);
            var index     = _repository.IndexOf(oldMobile);

            _repository[index] = mobile;

            return(_repository[index]);
        }
コード例 #17
0
        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);
        }
コード例 #18
0
ファイル: NetworkServiceUtil.cs プロジェクト: 007vel/Terra
        public static void Log(string str, bool printConsole = true)
        {
            IMobile mobile = DependencyService.Get <IMobile>();

            if (printConsole)
            {
                Console.WriteLine(str);
            }
            mobile.Log(str);
        }
コード例 #19
0
        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);
        }
コード例 #20
0
ファイル: AggressorInfo.cs プロジェクト: nydehi/divinity
        private AggressorInfo(IMobile attacker, IMobile defender, bool criminal)
        {
            m_Attacker = attacker;
            m_Defender = defender;

            m_CanReportMurder    = criminal;
            m_CriminalAggression = criminal;

            Refresh();
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        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);
        }
コード例 #23
0
        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);
        }
コード例 #24
0
        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);
        }
コード例 #25
0
        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);
        }
コード例 #26
0
ファイル: ModelDemo2.cs プロジェクト: unfeelia/Engine
 public void Interract(IMobile from, IOwnable to)
 {
     if (to.Disable)
     {
         return;
     }
     else
     {
         to.SetOwnerID(from.GetOwnerID());
     }
 }
コード例 #27
0
ファイル: Serialization.cs プロジェクト: nydehi/divinity
 public override void Write(IMobile value)
 {
     if (value == null || value.Deleted)
     {
         Write(Serial.MinusOne);
     }
     else
     {
         Write(value.Serial);
     }
 }
コード例 #28
0
        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));
        }
コード例 #29
0
        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);
            }
        }
コード例 #30
0
        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);
            }
        }
コード例 #31
0
 public void RemoveMobileObject(IMobile toRemove)
 {
     if (_objectsToMove.Contains(toRemove)) { _objectsToMove.Remove(toRemove); }
 }
コード例 #32
0
 public void AddMobileObject(IMobile toAdd)
 {
     if (!_objectsToMove.Contains(toAdd)) { _objectsToMove.Add(toAdd); }
 }
コード例 #33
0
 public USBMountingState(IMobile aMobile)
 {
     myMobile = aMobile;
 }
コード例 #34
0
 public AdbState(IMobile aMobile)
 {
     myMobile = aMobile;
 }
コード例 #35
0
 public ChargingState(IMobile aMobile)
 {
     myMobile = aMobile;
 }