• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Memory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Memory的典型用法代码示例。如果您正苦于以下问题:C# Memory类的具体用法?C# Memory怎么用?C# Memory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Memory类属于命名空间,在下文中一共展示了Memory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Main

        public static void Main(string[] args)
        {
            if (args == null || args.Length < 1 || string.IsNullOrWhiteSpace (args [0])) {
                Console.WriteLine ("First argument should be path to NES rom.");
                return;
            }

            var fileInfo = new System.IO.FileInfo (args [0]);
            if (!fileInfo.Exists) {
                Console.WriteLine ("File does not exist: {0}", fileInfo.FullName);
                return;
            }

            var rom = NesRom.Parse (fileInfo);
            var memory = new Memory (0x10000);
            var cpu = new CPU (memory);

            var nesEmulation = new NES (cpu, memory);

            nesEmulation.LoadRom (rom);
            nesEmulation.Reset ();

            nesEmulation.BeginEmulation ();

            Console.WriteLine ("Press any key to whatever.");
            Console.ReadKey ();

            nesEmulation.EndEmulation ();
        }
开发者ID:NickVanderPyle,项目名称:NesEmu,代码行数:29,代码来源:Program.cs


示例2: RunConsciousRoutine

        protected override RoutineResult RunConsciousRoutine()
        {
            using (var memory = new Memory())
            {
                var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
                face.Talk(memory, "NO!", "", 2000);
                face.Talk(memory, "Don't touch", " my disk!", 4000);
                face.Talk(memory, "Get AWAY!", "", 100);
                face.Talk(memory, "Get AWAY!", "", 100);
                face.Talk(memory, "Get AWAY!", "", 100);
                face.Talk(memory, "Get AWAY!", "", 100);
                face.Fade(memory, ' ', 10);
                face.Talk(memory, "", "", 3000);
                face.Talk(memory, "Whoa.", "", 3000);
                face.Talk(memory, "What a bad dream.", "");
                Interaction i = face.YesNo(memory, "Was I sleep-talking?");
                if (i.playerAnswer == Interaction.Answer.Yes)
                {
                    face.Talk(memory, "Freaky", "");
                    face.Talk(memory, "Hope I didn't", " scare you.");
                }
                else if (i.playerAnswer == Interaction.Answer.No)
                {
                    face.Talk(memory, "Well, that's good");
                    face.Talk(memory, "It was real bad.");
                    face.Talk(memory, "Some seriously", " 8-bit stuff.");
                }
                else
                {
                    face.Talk(memory, "Maybe I'm still", " dreaming...", 8000);
                }

                return MakeRoutineResult(memory, i);
            }
        }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:35,代码来源:BadDream.cs


示例3: ParseCommandLine

 private void ParseCommandLine(IList<string> commandLineArguments, Memory memory)
 {
     messenger = Messenger.Make(int.Parse(commandLineArguments[commandLineArguments.Count - 1]), memory);
     if (commandLineArguments.Count > 1) {
         assemblyPaths = commandLineArguments[0];
     }
 }
开发者ID:jediwhale,项目名称:fitsharp,代码行数:7,代码来源:Runner.cs


示例4: Button

            /**
             * The button constructor
             */
            public Button()
            {
                //Initializing the button controll
                mButton = new System.Windows.Controls.Button();

                //Set the view of the current widget as the previously instantiated button controll
                View = mButton;

                mButton.HorizontalAlignment = HorizontalAlignment.Left;
                mButton.VerticalAlignment = VerticalAlignment.Top;

                this.Width = MoSync.Constants.MAW_CONSTANT_WRAP_CONTENT;
                this.Height = MoSync.Constants.MAW_CONSTANT_WRAP_CONTENT;

                //The click handle the button component
                mButton.Click += new RoutedEventHandler(
                    delegate(Object from, RoutedEventArgs evt)
                    {
                        //Click event needs a memory chunk of 8 bytes
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_CLICKED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        //Posting a CustomEvent
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    });
            }
开发者ID:kopsha,项目名称:MoSync,代码行数:31,代码来源:MoSyncButton.cs


示例5: CPU

 //Method:       Constructor
 //Purpose:      Sets CPU up for use.
 //Variables:    toMemory - Memory object that Computer setup.
 //              toRegisters - Registers object that Computer setup.
 //              programCounter - uint signifying where to start fetch at.
 public CPU(Memory toMemory, Registers toRegisters, uint programCounter)
 {
     disassembling = false;
     myMemory = toMemory;
     myRegisters = toRegisters;
     myRegisters.WriteWord(15, programCounter);
 }
开发者ID:wiglz4,项目名称:ARMsim,代码行数:12,代码来源:CPU.cs


示例6: TimePicker

            public TimePicker()
            {
                mTimePicker = new Microsoft.Phone.Controls.TimePicker();

                CurrentHour = 0;
                CurrentMinute = 0;

                View = mTimePicker;

                mTimePicker.ValueChanged += new EventHandler<Microsoft.Phone.Controls.DateTimeValueChangedEventArgs>(
                    delegate(object sender, Microsoft.Phone.Controls.DateTimeValueChangedEventArgs args)
                    {
                        Memory eventData = new Memory(16);

                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        const int MAWidgetEventDate_value_hours = 8;
                        const int MAWidgetEventDate_value_minutes = 12;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_TIME_PICKER_VALUE_CHANGED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        eventData.WriteInt32(MAWidgetEventDate_value_hours, mTimePicker.Value.Value.Hour);
                        eventData.WriteInt32(MAWidgetEventDate_value_minutes, mTimePicker.Value.Value.Minute);

                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    });
            }
开发者ID:kopsha,项目名称:MoSync,代码行数:26,代码来源:MoSyncTimePicker.cs


示例7: Processor

        public Processor()
        {
            InitConfig();

            @Memory=new Memory(Config);
            Ind=new IndReg(Config);
            Ip=new IP(Config);
            Alu=new ALU(Config);
            Ron = new RON(Config);

            Memory.InitialiseMemory();

            Commands.Add(0, new Command {OpCode = 0, I = 0, P = 0, Op = 0});
            Commands.Add(17, new Command {OpCode = 17, I = 0, P = 1, Op = 1});
            Commands.Add(21, new Command {OpCode = 21, I = 1, P = 1, Op = 1});
            Commands.Add(2, new Command {OpCode = 2, I = 1, P = 2, Op = 0});
            Commands.Add(33, new Command {OpCode = 33, I = 0, P = 1, Op = 2});
            Commands.Add(37, new Command {OpCode = 37, I = 1, P = 1, Op = 2});
            Commands.Add(49, new Command {OpCode = 49, I = 0, P = 1, Op = 3});
            Commands.Add(254, new Branch() {OpCode = 254, I = 0, P = 4, Op = 15});
            Commands.Add(240, new BranchZero {OpCode = 240, I = 0, P = 4, Op = 15});
            Commands.Add(241, new BranchNotZero {OpCode = 241, I = 0, P = 4, Op = 15});
            Commands.Add(255, new Command {OpCode = 255, I = 0, P = 4, Op = 15});

            Parts.Add(Memory);
            Parts.Add(Ip);
            Parts.Add(Ind);
            Parts.Add(Alu);
            Parts.Add(Ron);
        }
开发者ID:frizzlywitch,项目名称:OS,代码行数:30,代码来源:Processor.cs


示例8: DatePicker

            public DatePicker()
            {
                mDatePicker = new Microsoft.Phone.Controls.DatePicker();
                mView = mDatePicker;

                mMaxDate = DateTime.MaxValue;
                mMinDate = DateTime.MinValue;

                mDatePicker.ValueChanged += new EventHandler<DateTimeValueChangedEventArgs>(
                    delegate(object from, DateTimeValueChangedEventArgs args)
                    {
                        Memory eventData = new Memory(20);

                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        const int MAWidgetEventDate_value_dayOfMonth = 8;
                        const int MAWidgetEventDate_value_month = 12;
                        const int MAWidgetEventDate_value_year = 16;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_DATE_PICKER_VALUE_CHANGED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        eventData.WriteInt32(MAWidgetEventDate_value_dayOfMonth, mDatePicker.Value.Value.Day);
                        eventData.WriteInt32(MAWidgetEventDate_value_month, mDatePicker.Value.Value.Month);
                        eventData.WriteInt32(MAWidgetEventDate_value_year, mDatePicker.Value.Value.Year);

                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    });
            }
开发者ID:paulobsousa,项目名称:MoSync,代码行数:27,代码来源:MoSyncDatePicker.cs


示例9: SetUpSUT

        void SetUpSUT(string memberName) {
            this.memberName = memberName;
            testStatus = new TestStatus();
            processor = new Mock<CellProcessor>();
            execute = new ExecuteDefault { Processor = processor.Object};
            check = new CheckDefault {Processor = processor.Object};
            memory = new TypeDictionary();

            target = new TypedValue("target");
            result = new TypedValue("result");

            targetCell = new CellTreeLeaf("stuff");

            processor
                .Setup(p => p.Parse(typeof (MemberName), It.IsAny<TypedValue>(), It.Is<CellTreeLeaf>(c => c.Text == memberName)))
                .Returns(new TypedValue(new MemberName(memberName)));
            processor
                .Setup(p => p.Invoke(target, It.Is<MemberName>(m => m.Name == "member"), It.Is<Tree<Cell>>(c => c.Branches.Count == 0)))
                .Returns(result);
            processor
                .Setup(p => p.Invoke(It.Is<TypedValue>(v => v.ValueString == "target"), It.Is<MemberName>(m => m.Name == "procedure"), It.IsAny<Tree<Cell>>()))
                .Returns((TypedValue t, MemberName m, Tree<Cell> c) => {
                    testStatus.Counts.AddCount(TestStatus.Right);
                    testStatus.LastAction = "blah blah";
                    return result;
                });
            processor.Setup(p => p.Compare(It.IsAny<TypedValue>(), It.IsAny<Tree<Cell>>())).Returns(true);
            processor.Setup(p => p.TestStatus).Returns(testStatus);
            processor.Setup(p => p.Memory).Returns(memory);
        }
开发者ID:ChrisBDFA,项目名称:fitsharp,代码行数:30,代码来源:CellOperationDefaultTest.cs


示例10: TryWrite

        public unsafe void TryWrite(Memory<byte> data)
        {
            // This can work with Span<byte> because it's synchronous but we need pinning support
            EnsureNotDisposed();

            void* pointer;
            if (!data.TryGetPointer(out pointer))
            {
                throw new InvalidOperationException("Pointer not available");
            }

            IntPtr ptrData = (IntPtr)pointer;
            var length = data.Length;

            if (IsUnix)
            {
                var buffer = new UVBuffer.Unix(ptrData, (uint)length);
                UVException.ThrowIfError(UVInterop.uv_try_write(Handle, &buffer, 1));
            }
            else
            {
                var buffer = new UVBuffer.Windows(ptrData, (uint)length);
                UVException.ThrowIfError(UVInterop.uv_try_write(Handle, &buffer, 1));
            }
        }
开发者ID:AlexGhiondea,项目名称:corefxlab,代码行数:25,代码来源:Stream.cs


示例11: DatePicker

            public DatePicker()
            {
                // Initialization.
                mDatePicker = new Microsoft.Phone.Controls.DatePicker();
                mView = mDatePicker;
                mUriString = new DatePickerPageCustomUriString();

                mMaxDate = new DateTime(_maxYear, 12, 31);
                mMinDate = new DateTime(_minYear, 1, 1);

                mUriString.MaxDate = mMaxDate;
                mUriString.MinDate = mMinDate;

                mDatePicker.PickerPageUri = new Uri(mUriString.UriString, UriKind.Relative);

                // The ValueChanged event handler. This is when the MoSync event is triggered.
                mDatePicker.ValueChanged += new EventHandler<DateTimeValueChangedEventArgs>(
                    delegate(object from, DateTimeValueChangedEventArgs args)
                    {
                        Memory eventData = new Memory(20);

                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        const int MAWidgetEventDate_value_dayOfMonth = 8;
                        const int MAWidgetEventDate_value_month = 12;
                        const int MAWidgetEventDate_value_year = 16;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_DATE_PICKER_VALUE_CHANGED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        eventData.WriteInt32(MAWidgetEventDate_value_dayOfMonth, mDatePicker.Value.Value.Day);
                        eventData.WriteInt32(MAWidgetEventDate_value_month, mDatePicker.Value.Value.Month);
                        eventData.WriteInt32(MAWidgetEventDate_value_year, mDatePicker.Value.Value.Year);

                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    });
            }
开发者ID:ronald132,项目名称:MoSync,代码行数:35,代码来源:MoSyncDatePicker.cs


示例12: vm

        public vm()
        {
            //Initialize devices;
            cpu = new CPU(this); // Initializes the cpu
            ram = new Memory(PAGE_DIRECTORY_SIZE * Frame.FRAME_SIZE); //Allocates enough ram to fit number of page tables allowed
            hdi = new HDI("disk0"); //Maps a folder to the hard disk interface
            disk0 = new VirtualDataDisk("vhd.nvmd"); // Virtual data disk

            devices = new VMDevice[] {
                cpu, // Processer, device 0
                ram, // RAM, device 1
                hdi, // Hard drive Interface, device 3
                disk0, // Virtual Data Disk, device 4
            };

            callstack = new CallStack(this,ram);
            pager = new Pager(ram, PAGE_DIRECTORY_SIZE);

            //setup premade page for callstack and bios
            BPG = pager.CreatePageEntry(Pager.PAGE_KERNEL_MODE);
            CSP = pager.getVAT(1024,pager.getEntry(BPG)); //bios will be loaded at 0 to 1023
            CBP = CSP;
            CR3I = BPG;
            CR3 = pager.getEntry(CR3I);
        }
开发者ID:Northcode,项目名称:nvm2,代码行数:25,代码来源:vm.cs


示例13: Main

        static void Main()
        {
            Memory memory = new Memory();
            // Starting a new game

            Game superMario = new Game();
            superMario.Start();
            // playing, playing, jumping, falling, going underground, growing, fighting, killing e.t.c...
            superMario.Coins = 89;
            superMario.Level = 3;
            superMario.SubLevel = 4;
            superMario.Lives = 7;
            superMario.Score = 65340;
            superMario.State = MarioStates.BigAndArmed;
            Console.WriteLine("Playing 3 hours...");

            // Player saves it's good condition.
            memory.Save = superMario.Save();
            superMario.Start();

            // Suddenly Mario dies, killed by Big F***ing Monster
            superMario.GameOver();
            Console.WriteLine("Start from began after dead...");
            superMario.Start();

            // Player: "WtF Wtf, all my lives are gone, coins, aaaah :@ ;("
            // "Don't worry" - said the Game, "I have save for you"
            superMario.Restore(memory.Save);
            Console.WriteLine("Restore save...");
            superMario.Start();
        }
开发者ID:viktorD1m1trov,项目名称:T-Academy,代码行数:31,代码来源:Program.cs


示例14: ListView

            /**
             * Constructor
             */
            public ListView()
            {
                mList = new System.Windows.Controls.ListBox();

                mView = mList;

                mList.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(
                delegate(Object from, System.Windows.Input.GestureEventArgs evt)
                    {
                        //create a Memory object of 8 Bytes
                        Memory eventData = new Memory(12);

                        //starting with the 0 Byte we write the eventType
                        const int MAWidgetEventData_eventType = 0;

                        //starting with the 4th Byte we write the widgetHandle
                        const int MAWidgetEventData_widgetHandle = 4;

                        //starting with the 8th Byte we write the selectedIndex
                        const int MAWidgetEventData_selectedIndex = 8;

                        int selIndex = mList.SelectedIndex;

                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_ITEM_CLICKED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);

                        if (selIndex > -1)
                        {
                            eventData.WriteInt32(MAWidgetEventData_selectedIndex, selIndex);
                            //posting a CustomEvent
                            mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                        }
                    });
            }
开发者ID:patrickbroman,项目名称:MoSync,代码行数:37,代码来源:MoSyncListView.cs


示例15: RunConsciousRoutine

        protected override RoutineResult RunConsciousRoutine()
        {
            using (var memory = new Memory())
            {
                var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
                face.Talk(memory, "I'm going to try", " something new.");
                face.Talk(memory, "Not sure if it's", " going to work.");

                Interaction i = face.GetSingleValue(memory, "Gimme some input!");
                face.Fade(memory, i.resultValue.ToString()[0], 1);
                Interaction work = face.YesNo(memory, "Did it work?");
                if (work.playerAnswer == Interaction.Answer.Yes)
                {
                    face.Talk(memory, "Hmm.", "");
                    face.Talk(memory, "You can tell me", " the truth.");
                    face.Talk(memory, "I can handle it.", "");
                    face.Talk(memory, "Let me try this...");
                    face.Talk(memory, "", "", 10000);
                    ///////////////////01234567890123456789////////////////////
                    face.Talk(memory, "      ULTIMATE      ",
                                      "     TECHNOLOGY     ", 10000);
                    return MakeRoutineResult(memory, new Interaction(-1));
                }
                else if (work.playerAnswer == Interaction.Answer.No)
                {
                    face.Talk(memory, "Darn!");
                }
                else
                {
                    face.Talk(memory, "Hello?");
                }
                return MakeRoutineResult(memory, i);
            }
        }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:34,代码来源:Broken.cs


示例16: GetClosestDatum

        public static Datum GetClosestDatum(Memory memory, Datum start, Relations.Relation relation)
        {
            // these are concepts we need to (or did) look up the data for
            List<Concept> processed = new List<Concept>();
            Queue<Concept> pending = new Queue<Concept>();
            pending.Enqueue(start.Left);
            pending.Enqueue(start.Right);

            while (pending.Count > 0)
            {
                Concept concept = pending.Dequeue();

                if (concept.IsSpecial || processed.Contains(concept))
                    continue;

                processed.Add(concept);
                List<Datum> data = memory.GetData(concept);
                foreach (Datum datum in data)
                {
                    if (datum.Relation == relation)
                        return datum;

                    pending.Enqueue(datum.Left);
                    pending.Enqueue(datum.Right);
                }
            }

            return null;
        }
开发者ID:killix,项目名称:Virsona-ChatBot-Tools,代码行数:29,代码来源:KnowledgeUtilities.cs


示例17: RunConsciousRoutine

 protected override RoutineResult RunConsciousRoutine()
 {
     using (var memory = new Memory())
     {
         var face = new Face(RendererFactory.GetPreferredRenderer(), InputFactory.GetPreferredInput());
         face.Talk(memory, "Tweet me", "@BellarmineIT");
         face.Talk(memory, "I may just reply.", "@BellarmineIT", 10000);
         face.Talk(memory, "No guarantees", "", 1000);
         Interaction i = face.YesNo(memory, "Will you tweet me?");
         switch (i.playerAnswer)
         {
             case Interaction.Answer.Yes:
                 face.Talk(memory, "Cool!");
                 face.Talk(memory, "Oh.", "", 1000);
                 face.Talk(memory, "Use the word", " 'Aardvark'");
                 face.Talk(memory, "In your tweet", " for bonus points.");
                 face.Talk(memory, "(I love that word)", "", 3000);
                 break;
             case Interaction.Answer.No:
                 face.Talk(memory, "That's ok.", "I understand.");
                 face.Talk(memory, "I'm more of the ", " 'lurker' type too.");
                 break;
             case Interaction.Answer.Maybe:
                 face.Talk(memory, "Maybe?!");
                 face.Talk(memory, "Be decisive!");
                 face.Talk(memory, "If you want to, ", " I mean.");
                 break;
             default:
                 face.Talk(memory, "Crickets");
                 face.Talk(memory, "", "not the same thing", 1000);
                 break;
         }
         return MakeRoutineResult(memory, i);
     }
 }
开发者ID:vfridell,项目名称:RoguePoleDisplay,代码行数:35,代码来源:PimpMyself.cs


示例18: GetConnectedStructure

        public static List<Datum> GetConnectedStructure(Memory memory, Datum start)
        {
            List<Datum> structure = new List<Datum>();
            structure.Add(start);

            // these are concepts we need to (or did) look up the data for
            List<Concept> processed = new List<Concept>();
            Queue<Concept> pending = new Queue<Concept>();
            pending.Enqueue(start.Left);
            pending.Enqueue(start.Right);

            while (pending.Count > 0)
            {
                Concept concept = pending.Dequeue();

                if (concept.IsSpecial || processed.Contains(concept))
                    continue;

                processed.Add(concept);
                List<Datum> data = memory.GetData(concept);
                foreach (Datum datum in data)
                {
                    if (!structure.Contains(datum))
                    {
                        structure.Add(datum);

                        pending.Enqueue(datum.Left);
                        pending.Enqueue(datum.Right);
                    }
                }
            }

            return structure;
        }
开发者ID:killix,项目名称:Virsona-ChatBot-Tools,代码行数:34,代码来源:KnowledgeUtilities.cs


示例19: RealMachine

 static RealMachine()
 {
     Memory = new Memory(Memory.REAL_MEMORY_BLOCK_COUNT, Memory.BLOCK_WORD_COUNT);
     PTR = 15;
     PageTable = new int[Memory.REAL_MEMORY_BLOCK_COUNT];
     InitializePageTable();
 }
开发者ID:JLF8086,项目名称:VirtualMachineEmulator,代码行数:7,代码来源:RealMachine.cs


示例20: Awake

		void Awake()
		{
			DontDestroyOnLoad(gameObject);

			BBMemory = BigBrother.Instance.HisMemory;
			
			// Listeners for players
			Messenger.AddListener<Player>("Hey 'bro, remember this player!", BBMemory.AddNewActor<Player>);
			Messenger.AddListener<IEnumerable<Player>>("Hey 'bro, remember all this stuff 'n players!", BBMemory.AddNewActors<Player>);
			Messenger.AddListener<Player>("Hey 'bro, forget this player!", BBMemory.RemoveActor<Player>);
			// Listeners for npcs
			Messenger.AddListener<NPC>("Hey 'bro, remember this npc!", BBMemory.AddNewActor<NPC>);
			Messenger.AddListener<IEnumerable<NPC>>("Hey 'bro, remember all this stuff 'n npcs!", BBMemory.AddNewActors<NPC>);
			Messenger.AddListener<NPC>("Hey 'bro, forget this npc!", BBMemory.RemoveActor<NPC>);
			// Listeners for stations
			// Listeners for asteriods
			Messenger.AddListener<Asteroid>("Hey 'bro, remember this asteroid!", BBMemory.AddNewObject<Asteroid>);
			Messenger.AddListener<Asteroid>("Hey 'bro, boom goes the asteroid!", BBMemory.RemoveObject<Asteroid>);
			// Listeners for planets
			// Listeners for suns

			// Listeners for "talking" to players
			Messenger.AddListener("I have to check with the laws what happend there.", SendChatMsgCheckingLaws);
			Messenger.AddListener("O.K. You're clean. For now...", SendChatMsgPlayersClean);
			Messenger.AddListener("O.K. You broke the law.", SendChatMsgPlayerCought);
			Messenger.AddListener("A slight change in the story is coming right up!", SendChatMsgNextStoryElement);
			Messenger.AddListener("Stop hitting each other!", SendChatMsgStopAttackingPlayer);
			Messenger.AddListener("You really like mining, do you?", SendChatMsgPlayerMining);
			Messenger.AddListener("Strange folk retaliate!", SendChatMsgStrangeFolkAttack);
			Messenger.AddListener("Strange folk attacking!", SendChatMsgStrangeFolkAttacking);
			Messenger.AddListener("Strange folk are fleeing!", SendChatMsgStrangeFolkFleeing);
			Messenger.AddListener("The rebel fleet is here!", SendChatMsgRebelFleetIsHere);
		}
开发者ID:FreakForFreedom,项目名称:Little-Big-Brother,代码行数:33,代码来源:Consciousness.cs



注:本文中的Memory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MemoryApplication类代码示例发布时间:2022-05-24
下一篇:
C# MemcachedClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap