コード例 #1
0
ファイル: Hud.cs プロジェクト: soltys/Soltys-Programmer-Bot
        public Hud(Game currentGame, IHudRenderer renderer,
            IRenderer<CommandBar> commandBarRenderer, IRenderer<CommandMainProgram> mainProgramRenderer, IRenderer<CommandFunction> functionOneRenderer, IRenderer<CommandFunction> functionTwoRenderer,
            IHudIconFactory iconFactory)
            : base(currentGame)
        {
            this.renderer = renderer;
            this.iconFactory = iconFactory;
               // HudHeight = 786;
               // HudWidth = 1024;
            CommandBar = new CommandBar(this, commandBarRenderer, iconFactory);
            MainProgram = new CommandMainProgram(this, mainProgramRenderer, iconFactory);
            FunctionOne = new CommandFunction(this, functionOneRenderer, iconFactory);
            FunctionOne.DefaultEmptyIcon = iconFactory.EmptyFunctionOneIcon;
            FunctionOne.AddEmptyIcons(iconFactory);
            FunctionTwo = new CommandFunction(this, functionTwoRenderer, iconFactory);
            FunctionTwo.DefaultEmptyIcon = iconFactory.EmptyFunctionTwoIcon;
            FunctionTwo.AddEmptyIcons(iconFactory);
            Message = new HudMessage();

            IconRelease += MainProgram.SetGrabbedIcon;
            IconRelease += FunctionOne.SetGrabbedIcon;
            IconRelease += FunctionTwo.SetGrabbedIcon;

            IconGrab += CommandBar.GrabIcon;
            IconGrab += MainProgram.GrabIcon;
            IconGrab += FunctionOne.GrabIcon;
            IconGrab += FunctionTwo.GrabIcon;

            Message.FirstLine = "";
            Message.SecondLine = "";
        }
コード例 #2
0
 public void AddEmptyIcons(IHudIconFactory factory)
 {
     for (int i = 0; i < size; i++)
     {
         IconList.Add(DefaultEmptyIcon.Clone());
     }
 }
コード例 #3
0
 public CommandMainProgram(Hud currentHud, IRenderer<CommandMainProgram> renderer, IHudIconFactory factory)
     : base(currentHud)
 {
     this.renderer = renderer;
     IconFactory = factory;
     DefaultEmptyIcon = factory.EmptyIcon;
     for (int i = 0; i < PROGRAM_SIZE; i++)
     {
         IconList.Add(factory.EmptyIcon);
     }
 }
コード例 #4
0
 public CommandBar(Hud currentHud, IRenderer<CommandBar> render, IHudIconFactory factory)
     : base(currentHud)
 {
     this.renderer = render;
     IconList.Add(factory.UpIcon);
     IconList.Add(factory.TurnLeftIcon);
     IconList.Add(factory.TurnRightIcon);
     IconList.Add(factory.JumpIcon);
     IconList.Add(factory.LightIcon);
     IconList.Add(factory.FunctionOneIcon);
     IconList.Add(factory.FunctionTwoIcon);
 }
コード例 #5
0
 public CommandFunction(Hud currentHud, IRenderer<CommandFunction> renderer, IHudIconFactory factory)
     : base(currentHud)
 {
     this.renderer = renderer;
     this.IconFactory = factory;
 }