コード例 #1
0
ファイル: MemoryAmie.cs プロジェクト: ShadowMario3/PKHeX
        private void UpdateMemoryDisplay(object sender)
        {
            if (sender == CB_OTMemory)
            {
                int memoryGen = pkm.Generation;
                if (memoryGen < 0)
                {
                    memoryGen = pkm.Format;
                }

                int memory   = WinFormsUtil.GetIndex((ComboBox)sender);
                var memIndex = Memories.GetMemoryArgType(memory, memoryGen);
                var argvals  = MemStrings.GetArgumentStrings(memIndex, memoryGen);
                CB_OTVar.InitializeBinding();
                CB_OTVar.DataSource = new BindingSource(argvals, null);
                LOTV.Text           = TextArgs.GetMemoryCategory(memIndex, memoryGen);
                LOTV.Visible        = CB_OTVar.Visible = CB_OTVar.Enabled = argvals.Count > 1;
            }
            else
            {
                int memoryGen = pkm.Format;
                int memory    = WinFormsUtil.GetIndex((ComboBox)sender);
                var memIndex  = Memories.GetMemoryArgType(memory, memoryGen);
                var argvals   = MemStrings.GetArgumentStrings(memIndex, memoryGen);
                CB_CTVar.InitializeBinding();
                CB_CTVar.DataSource = new BindingSource(argvals, null);
                LCTV.Text           = TextArgs.GetMemoryCategory(memIndex, memoryGen);
                LCTV.Visible        = CB_CTVar.Visible = CB_CTVar.Enabled = argvals.Count > 1;
            }
        }
コード例 #2
0
ファイル: Wish.cs プロジェクト: Sielfyr/Dream
 protected virtual void InitThought(Thought_Wish thought, bool group)
 {
     thought.fromWish     = def;
     thought.groupPerWish = group;
     thought.wishDesc     = LabelCap;
     Memories.TryGainMemory(thought);
 }
コード例 #3
0
        private void UpdateMemoryDisplay(object sender)
        {
            int memory   = WinFormsUtil.GetIndex((ComboBox)sender);
            var memIndex = Memories.GetMemoryArgType(memory);
            var argvals  = GameInfo.Strings.Memories.GetArgumentStrings(memIndex);
            int index    = (int)memIndex - 1;

            if (sender == CB_CTMemory)
            {
                CB_CTVar.DisplayMember = nameof(ComboItem.Text);
                CB_CTVar.ValueMember   = nameof(ComboItem.Value);
                CB_CTVar.DataSource    = new BindingSource(argvals, null);
                if (index >= 0)
                {
                    LCTV.Text = vartypes[index];
                }
                LCTV.Visible = CB_CTVar.Visible = CB_CTVar.Enabled = argvals.Count > 1;
            }
            else
            {
                CB_OTVar.DisplayMember = nameof(ComboItem.Text);
                CB_OTVar.ValueMember   = nameof(ComboItem.Value);
                CB_OTVar.DataSource    = new BindingSource(argvals, null);
                if (index >= 0)
                {
                    LOTV.Text = vartypes[index];
                }
                LOTV.Visible = CB_OTVar.Visible = CB_OTVar.Enabled = argvals.Count > 1;
            }
        }
コード例 #4
0
 private void onAddMemory(object obj)
 {
     if (obj != null)
     {
         if (!String.IsNullOrEmpty(obj.ToString()))
         {
             string callsign = obj.ToString();
             if (!isDupe(callsign))
             {
                 Memory   memory = new Memory();
                 DateTime dt     = DateTime.UtcNow;
                 memory.Callsign  = callsign;
                 memory.Date      = dt.Date.ToString("dd-MMM-yyyy");
                 memory.Time      = dt.ToString("HH:mm:ss");
                 memory.Frequency = frequency;
                 memory.Mode      = mode;
                 Memories.Add(memory);
                 saveMemoryList();
                 closeWindow();
             }
             else
             {
                 ErrorMessage = "Callsign and frequency already in list.";
             }
         }
     }
 }
コード例 #5
0
ファイル: IMemoryHT.cs プロジェクト: zzzzRuby/PKHeX
 /// <summary>
 /// Sets a Link Trade memory to the <see cref="ht"/>.
 /// </summary>
 public static void SetTradeMemoryHT(this IMemoryHT ht, bool bank)
 {
     ht.HT_Memory    = 4;                                            // Link trade to [VAR: General Location]
     ht.HT_TextVar   = bank ? 0 : 9;                                 // Somewhere (Bank) : Pokécenter (Trade)
     ht.HT_Intensity = 1;
     ht.HT_Feeling   = Memories.GetRandomFeeling(4, bank ? 10 : 20); // 0-9 Bank, 0-19 Trade
 }
コード例 #6
0
        async Task SaveMemory()
        {
            // Close the Popup
            ShowPopup = false;
            // Get the current user
            var user = (await authenticationStateTask).User;

            // A new forecast will have the Id set to 0
            if (objMemories.Id == 0)
            {
                MemType objMemType = new MemType();
                // Create new forecast
                Memories objNewMemories = new Memories();
                objNewMemories.memDate = System.DateTime.Now;
                objNewMemories.memType = TypeOfMemories.ToString();
                objNewMemories.memText = objMemories.memText;

                objNewMemories.UserName = user.Identity.Name;
                // Save the result
                var result =
                    @Service.CreateMemoriesAsync(objNewMemories);
            }
            else
            {
                // This is an update
                var result =
                    @Service.UpdateMemoriesAsync(objMemories);
            }
            // Get the forecasts for the current user
            memories =
                await @Service.GetMemoriesAsync(user.Identity.Name);
        }
コード例 #7
0
    private List <ComboItem> GetItems(int memoryGen)
    {
        var permit = Memories.GetMemoryItemParams(memoryGen);
        var asInt  = permit.ToArray();

        return(Util.GetCBList(s.itemlist, asInt));
    }
コード例 #8
0
ファイル: zeliard.cs プロジェクト: andyhebear/extramegablob
        public override void inbox(Event ev)
        {
            switch (ev._Keyword)
            {
            case KeyWord.STATE_BROADCASTING:
                if (ev._Memories[KeyWord.TESTLOOP] != null)
                {
                    int g = Int32.Parse(ev._Memories[KeyWord.TESTLOOP].Value) + 1;
                    log("testloop: " + g.ToString());

                    Memory   mem  = new Memory("", KeyWord.TESTLOOP, g.ToString());
                    Memories mems = new Memories();
                    mems.Add(mem);
                    Event ev2 = new Event();
                    ev2._Keyword            = KeyWord.STATE_BROADCASTING;
                    ev2._Memories           = mems;
                    ev2._IntendedRecipients = eventScope.SERVERALL;
                    base.outboxMessage(this, ev2);
                    addCheeriosBox();
                    //string attacker = ev._Memories[KeyWord.STATE_READY].Value;
                    //addZelBox();
                    //for (int i = 0; i < ZelBoxesSNs.Count; i++)
                    //{
                    //    SceneNode sninquestion = ((SceneNode)ZelBoxesSNs[i]);
                    //    if (sninquestion.Name == attacker)
                    //    {
                    //        //float scale = ((float)ran.NextDouble() * 2);
                    //        sninquestion.ResetToInitialState();
                    //    }
                    //}
                }
                break;
            }
        }
コード例 #9
0
ファイル: Wish.cs プロジェクト: Sielfyr/Dream
        public void RemoveOneMemoryOfDef(ThoughtDef thoughtDef, ref int count)
        {
            if (count <= 0)
            {
                return;
            }

            for (int i = 0; i < Memories.Memories.Count; i++)
            {
                if (!(Memories.Memories[i] is Thought_Wish))
                {
                    continue;
                }
                Thought_Wish thought_Memory = (Thought_Wish)Memories.Memories[i];
                if (thought_Memory.def == thoughtDef && thought_Memory.CurStageIndex == TierIndex)
                {
                    if (thought_Memory.fromWish != def)
                    {
                        continue;
                    }
                    Memories.RemoveMemory(thought_Memory);
                    count--;
                    return;
                }
            }
            Log.Warning("HDream : try to remove a thougth of def :" + thoughtDef.label + " for wish : " + def.label + " but no thought of that def was found for pawn : " + pawn.Label + "");
            count = 0;
        }
コード例 #10
0
 /// <summary>
 /// Sets a random memory specific to <see cref="GameVersion.Gen6"/> locality.
 /// </summary>
 /// <param name="pk">Pokémon to modify.</param>
 public static void SetRandomMemory6(this PKM pk)
 {
     // for lack of better randomization :)
     pk.OT_Memory    = 63;
     pk.OT_Intensity = 6;
     pk.OT_Feeling   = Memories.GetRandomFeeling(pk.OT_Memory);
 }
コード例 #11
0
        public async Task <IActionResult> Details(int id, HomeDetailsViewModel model)
        {
            if (ModelState.IsValid)
            {
                var game = gameRepository.GetById(id);
                var user = await userManager.GetUserAsync(HttpContext.User);

                if (game == null)
                {
                    Response.StatusCode = 404;
                    return(View("NotFound"));
                }
                if (user == null)
                {
                    return(View("NotFound"));
                }
                Memories memories = new Memories()
                {
                    gameId     = game.Id,
                    Memory     = model.Memories.Memory,
                    UserId     = user.Id,
                    UserName   = user.UserName,
                    DatePosted = DateTime.Now
                };
                memorieRepository.AddMemories(memories);
                return(RedirectToAction("details", new { id = game.Id }));
            }
            return(View(model));
        }
コード例 #12
0
        public MemoryAllocationPage()
        {
            this.InitializeComponent();
            for (int i = 0; i < 32; i++)
            {
                Memories.Add(new Memory
                {
                    Task = null
                });
            }
            Random random = new Random();

            MemoryGrid.ItemsSource = null;
            MemoryGrid.ItemsSource = Memories;
            DoTasks.Add(new DoTask
            {
                Id     = 0,
                Length = random.Next(1, 18),
                Color  = "Red"
            });
            DoTasks.Add(new DoTask
            {
                Id     = 1,
                Length = random.Next(1, 18),
                Color  = "Green"
            });
            DoTasks.Add(new DoTask
            {
                Id     = 2,
                Length = random.Next(1, 18),
                Color  = "DarkBlue"
            });
            DoTasks.Add(new DoTask
            {
                Id     = 3,
                Length = random.Next(1, 18),
                Color  = "LightBlue"
            });
            DoTasks.Add(new DoTask
            {
                Id     = 4,
                Length = random.Next(1, 18),
                Color  = "YellowGreen"
            });
            DoTasks.Add(new DoTask
            {
                Id     = 5,
                Length = random.Next(1, 18),
                Color  = "DarkGray"
            });

            foreach (var t in DoTasks)
            {
                TasksInfo += $"TaskId: {t.Id}\tLength: {t.Length}\n";
            }

            Tasks.Text = string.Empty;
            Tasks.Text = TasksInfo;
        }
コード例 #13
0
 void EditMemories(Memories memories)
 {
     // Set the selected forecast
     // as the current forecast
     objMemories = memories;
     // Open the Popup
     ShowPopup = true;
 }
コード例 #14
0
 /// <summary>
 /// Sets the Memory details to a Hatched Egg's memories.
 /// </summary>
 /// <param name="pk">Pokémon to modify.</param>
 public static void SetHatchMemory6(this PKM pk)
 {
     pk.OT_Memory    = 2;
     pk.OT_Affection = 0;
     pk.OT_Feeling   = Memories.GetRandomFeeling(pk.OT_Memory);
     pk.OT_Intensity = 1;
     pk.OT_TextVar   = pk.XY ? 43 : 27; // riverside road : battling spot
 }
コード例 #15
0
 void AddNewMemory()
 {
     // Make new forecast
     objMemories = new Memories();
     // Set Id to 0 so we know it is a new record
     objMemories.Id = 0;
     // Open the Popup
     ShowPopup = true;
 }
コード例 #16
0
ファイル: Engine.cs プロジェクト: HosseinParizad/PotentMS
        static void AddMemoryItem(string id, string groupKey, string memberKey, string text, string hint, string parentId, DateTimeOffset actionTime, MemoryType memoryType)
        {
            var memory = new MemoryItem {
                Id = id, ParentId = parentId, GroupKey = groupKey, MemberKey = memberKey, Hint = hint, Text = text, MemoryType = memoryType, Stage = MemoryStage.Stage0
            };

            Memories.Add(memory);
            SendFeedbackMessage(type: MsgType.Success, actionTime: actionTime, action: MapAction.MemoryFeedback.NewMemoryAdded.Name, content: memory);
        }
コード例 #17
0
 public bool EqualByMembers(Computer computer)
 {
     return(computer != null &&
            ComputerType == computer.ComputerType &&
            ModelEqualityByMembers <Processor> .EqualByMembers(Processor, computer.Processor) &&
            Memories.IsEquals(computer.Memories, new ModelEqualityByMembers <Memory>()) &&
            Disks.IsEquals(computer.Disks, new ModelEqualityByMembers <Disk>()) &&
            ModelEqualityByMembers <MotherBoard> .EqualByMembers(MotherBoard, computer.MotherBoard) &&
            Gpus.IsEquals(computer.Gpus, new ModelEqualityByMembers <Gpu>()));
 }
コード例 #18
0
ファイル: UIManager.cs プロジェクト: RavBit/REMEMBERTHIS
    public void StartMemory()
    {
        System.Random rnd = new System.Random();
        int           r   = rnd.Next(MemoryManager.instance._memories.Count);
        Memories      m   = MemoryManager.instance._memories[r];

        MemoryManager.instance._currentmemory = m;
        Debug.Log(MemoryManager.instance._currentmemory.name);
        SceneManager.LoadSceneAsync("Memory");
    }
コード例 #19
0
        private void onDeleteMemory(object obj)
        {
            Memory memory = obj as Memory;

            if (memory != null)
            {
                Memories.Remove(memory);
                saveMemoryList();
            }
        }
コード例 #20
0
 public Task <int> SaveMemories(Memories memories)
 {
     if (memories.MemoryID != 0)
     {
         return(_database.UpdateAsync(memories));
     }
     else
     {
         return(_database.InsertAsync(memories));
     }
 }
コード例 #21
0
        public void sendCap(byte[] capFrameBytes)
        {
            Memories mems = new Memories();

            mems.Add(new Memory("", KeyWord.CAMCAP_JPG, "", capFrameBytes));
            Event ev = new Event();

            ev._Keyword            = KeyWord.CAMCAP;
            ev._Memories           = mems;
            ev._IntendedRecipients = EventTransfer.CLIENTTOSERVER;
            base.outboxMessage(this, ev);
        }
コード例 #22
0
        public async Task <IActionResult> insertMemories(Memories memories)
        {
            memories.createDate = DateTime.Now.toShamsi();
            var result = await memoriesRepository.insertMemories(memories);

            if (result == true)
            {
                await memoriesRepository.saveChanges();
            }

            return(RedirectToAction("Index"));
        }
コード例 #23
0
ファイル: Engine.cs プロジェクト: HosseinParizad/PotentMS
        internal static void LearnMemory(dynamic metadata, dynamic content)
        {
            var groupKey   = metadata.GroupKey.ToString();
            var id         = content.Id.ToString();
            var memoryItem = Memories.SingleOrDefault(d => d.Id == id);

            if (memoryItem != null)
            {
                var nextdate = Now;
                var stage    = memoryItem.Stage;
                switch (memoryItem.Stage)
                {
                case MemoryStage.Stage0:
                    stage = MemoryStage.Stage1;
                    break;

                case MemoryStage.Stage1:
                    nextdate = Now.AddDays(1);
                    stage    = MemoryStage.Stage2;
                    break;

                case MemoryStage.Stage2:
                    nextdate = Now.AddDays(3);
                    stage    = MemoryStage.Stage3;
                    break;

                case MemoryStage.Stage3:
                    nextdate = Now.AddDays(7);
                    stage    = MemoryStage.Stage4;
                    break;

                case MemoryStage.Stage4:
                    nextdate = Now.AddDays(14);
                    stage    = MemoryStage.Stage5;
                    break;

                case MemoryStage.Stage5:
                    nextdate = Now.AddDays(30);
                    stage    = MemoryStage.Stage6;
                    break;

                case MemoryStage.Stage6:
                    nextdate = DateTimeOffset.MaxValue;
                    break;

                default:
                    break;
                }
                memoryItem.NextMemorizeDate = nextdate;
                memoryItem.Stage            = stage;
            }
        }
コード例 #24
0
        public async void SaveNotesInDb()
        {
            Memories memories = new Memories()
            {
                MemoryText = MemoryText,
                //  Date = DateTime.UtcNow,
            };


            await Application.Database.SaveMemories(memories);

            await navigationService.Navigate <MyMemoriesViewModel>();
        }
コード例 #25
0
        public async Task <bool> deleteMemories(Memories Memories)
        {
            try
            {
                await Task.Run(() => db.Entry(Memories).State = EntityState.Deleted);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
コード例 #26
0
        public async Task <bool> insertMemories(Memories Memories)
        {
            try
            {
                await db.Memories.AddAsync(Memories);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
コード例 #27
0
ファイル: zeliard.cs プロジェクト: andyhebear/extramegablob
        public void initTestLoop()
        {
            Memory   mem  = new Memory("", KeyWord.TESTLOOP, "1");
            Memories mems = new Memories();

            mems.Add(mem);
            Event ev = new Event();

            ev._Keyword            = KeyWord.STATE_BROADCASTING;
            ev._Memories           = mems;
            ev._IntendedRecipients = eventScope.SERVERALL;
            base.outboxMessage(this, ev);
        }
コード例 #28
0
        private async Task LaunchTask(DoTask task, int index)
        {
            var range = Memories.GetRange(index, task.Length);

            foreach (var m in range)
            {
                m.Color    = task.Color;
                m.Occupied = true;
                m.Task     = task;
            }
            task.MemoryId  = index;
            task.TaskState = DoTask.State.INSTALLED;
        }
コード例 #29
0
 public ActionResult <MemoriesViewModel> MemoriesViewModel(Memories model, int skipNum = 0)
 {
     return(new MemoriesViewModel()
     {
         ID = model.ID,
         Title = model.Title,
         Tag = model.Tag,
         Remark = model.Remark,
         ShowTime = model.ShowTime,
         IsImage = model.IsImage,
         DataSource = model.DataSource,
         SkipNum = skipNum
     });
 }
コード例 #30
0
ファイル: MemoryApplicator.cs プロジェクト: zzzzRuby/PKHeX
 /// <summary>
 /// Sets the Memory details to a Hatched Egg's memories.
 /// </summary>
 /// <param name="pk">Pokémon to modify.</param>
 public static void SetHatchMemory6(this PKM pk)
 {
     if (pk is IMemoryOT o)
     {
         o.OT_Memory    = 2;
         o.OT_Feeling   = Memories.GetRandomFeeling(2);
         o.OT_Intensity = 1;
         o.OT_TextVar   = pk.XY ? 43 : 27; // riverside road : battling spot
     }
     if (pk is IAffection a)
     {
         a.OT_Affection = 0;
     }
 }
コード例 #31
0
ファイル: zeliard.cs プロジェクト: andyhebear/extramegablob
 public void initTestLoop()
 {
     Memory mem = new Memory("", KeyWord.TESTLOOP, "1");
     Memories mems = new Memories();
     mems.Add(mem);
     Event ev = new Event();
     ev._Keyword = KeyWord.STATE_BROADCASTING;
     ev._Memories = mems;
     ev._IntendedRecipients = eventScope.SERVERALL;
     base.outboxMessage(this, ev);
 }
コード例 #32
0
ファイル: zeliard.cs プロジェクト: andyhebear/extramegablob
        public override void inbox(Event ev)
        {
            switch (ev._Keyword)
            {
                case KeyWord.STATE_BROADCASTING:
                    if (ev._Memories[KeyWord.TESTLOOP] != null)
                    {
                        int g = Int32.Parse(ev._Memories[KeyWord.TESTLOOP].Value) + 1;
                        log("testloop: " + g.ToString());

                        Memory mem = new Memory("", KeyWord.TESTLOOP, g.ToString());
                        Memories mems = new Memories();
                        mems.Add(mem);
                        Event ev2 = new Event();
                        ev2._Keyword = KeyWord.STATE_BROADCASTING;
                        ev2._Memories = mems;
                        ev2._IntendedRecipients = eventScope.SERVERALL;
                        base.outboxMessage(this, ev2);
                        addCheeriosBox();
                        //string attacker = ev._Memories[KeyWord.STATE_READY].Value;
                        //addZelBox();
                        //for (int i = 0; i < ZelBoxesSNs.Count; i++)
                        //{
                        //    SceneNode sninquestion = ((SceneNode)ZelBoxesSNs[i]);
                        //    if (sninquestion.Name == attacker)
                        //    {
                        //        //float scale = ((float)ran.NextDouble() * 2);
                        //        sninquestion.ResetToInitialState();
                        //    }
                        //}
                    }
                    break;
            }
        }