Beispiel #1
0
        protected override void Start()
        {
            KoiSkinOverlayGui = Extension.Extension.TryGetPluginInstance("KSOX_GUI") as KoiSkinOverlayGui;
            CurrentCoordinate.Subscribe(onNext: delegate { ChangeCoordinate(); });

            base.Start();
        }
Beispiel #2
0
 protected override void Start()
 {
     Logger.Log(DebugLogLevel, "[Start] Fired!!");
     ResetCharaTriggerInfo();
     CurrentCoordinate.Subscribe(value => { OnCoordinateChanged(); });
     base.Start();
 }
Beispiel #3
0
        protected override void Awake()
        {
            base.Awake();
            OverlayStorage = new OverlayStorage(this);
#if KK
            CurrentCoordinate.Subscribe(v => UpdateTexture(0));
#endif
        }
            protected override void Start()
            {
#if KK
                // Ignore coordinate in EC
                CurrentCoordinate.Subscribe(value => { OnCoordinateChanged(); });
#endif
                base.Start();
            }
Beispiel #5
0
        protected override void Awake()
        {
            base.Awake();
            OverlayStorage = new OverlayStorage(this);
#if KK || KKS
            // this causes massive lag on overworld since charas change coords in background so avoid running this whenever possible
            CurrentCoordinate.Subscribe(v =>
            {
                if (OverlayStorage.IsPerCoord())
                {
                    UpdateTexture(WhatTexturesNeedUpdating());
                }
            });
#endif
        }
Beispiel #6
0
            protected override void Start()
            {
                if (KoikatuAPI.GetCurrentGameMode() == GameMode.MainGame)
                {
                    return;
                }
                HairAccessoryCustomizer = new HairAccessoryCustomizerSupport.UrineBag(ChaControl);
                MaterialEditor          = new MaterialEditorSupport.UrineBag(ChaControl);
                MaterialRouter          = new MaterialRouterSupport.UrineBag(ChaControl);
                AccStateSync            = new AccStateSyncSupport.UrineBag(ChaControl);
                DynamicBoneEditor       = new DynamicBoneEditorSupport.UrineBag(ChaControl);

                CurrentCoordinate.Subscribe(value => { OnCoordinateChanged(); });
                base.Start();
            }
Beispiel #7
0
        /// <summary>
        /// Calculates a range of coordinates based on the input commands
        /// </summary>
        /// <param name="input"></param>
        public void CalculateWireCoordinates(string input)
        {
            // Parse
            Tuple <string, int> commandSet = ParseCommandInput(input);

            // Process
            switch (commandSet.Item1)
            {
            case "R":
                for (int i = 0; i < commandSet.Item2; i++)
                {
                    IncreaseXCoordinate();
                    WireCoordinates.Add(CurrentCoordinate.ToArray());
                }
                break;

            case "L":
                for (int i = 0; i < commandSet.Item2; i++)
                {
                    DecreaseXCoordinate();
                    WireCoordinates.Add(CurrentCoordinate.ToArray());
                }
                break;

            case "U":
                for (int i = 0; i < commandSet.Item2; i++)
                {
                    IncreaseYCoordinate();
                    WireCoordinates.Add(CurrentCoordinate.ToArray());
                }
                break;

            case "D":
                for (int i = 0; i < commandSet.Item2; i++)
                {
                    DecreaseYCoordinate();
                    WireCoordinates.Add(CurrentCoordinate.ToArray());
                }
                break;

            default:
                // Should never happen
                break;
            }
        }
 //EC only has one outfit slot, no need to watch changes
 protected override void Start()
 {
     CurrentCoordinate.Subscribe(value => { OnCoordinateChanged(); });
     base.Start();
 }
Beispiel #9
0
 public string DisplayPosition()
 {
     return($"{CurrentCoordinate.ToString()} {CurrentDirection}");
 }
Beispiel #10
0
        public override async Task Part2()
        {
            var intComputer     = new Service.IntCodeComputer(ComputerMemoryInput, 0);
            var inputValue      = 0;
            var robot           = new Robot();
            var stride          = 300;
            var grid            = new int[stride, stride];
            var currentPosition = new Coordinate()
            {
                X = 0, Y = 0
            };
            var shiftX = 150;
            var shiftY = 150;
            var listPaintedCoordinates = new Dictionary <CurrentCoordinate, int>();
            var firstwhite             = true;

            while (true)
            {
                try
                {
                    var currentColor = (Color)grid[currentPosition.X + shiftX, currentPosition.Y + shiftY];
                    if (firstwhite)
                    {
                        currentColor = Color.White;
                        firstwhite   = false;
                    }

                    var values = intComputer.StartAndReturn2Outputs((int)currentColor);

                    if (values[2] == 1)
                    {
                        break;
                    }

                    grid[currentPosition.X + shiftX, currentPosition.Y + shiftY] = (int)values[0];
                    var coord = new CurrentCoordinate()
                    {
                        X = currentPosition.X, Y = currentPosition.Y
                    };
                    if (listPaintedCoordinates.TryAdd(new CurrentCoordinate()
                    {
                        X = currentPosition.X, Y = currentPosition.Y
                    }, 1))
                    {
                        listPaintedCoordinates[coord] += 1;
                    }
                    ;
                    //robot.Paint(values[0]);
                    robot.DetermineDirection((Direction)values[1]);
                    robot.Move();
                    Debug.WriteLine($"{values[0]} - {values[1]}");
                    currentPosition = robot.GetCurrentCoordinate();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }

            var paintedSquares = listPaintedCoordinates.Count();

            var puzzleAnswerBuilder = new StringBuilder();

            for (int y = stride - 1; y >= 0; y--)
            {
                for (int x = 0; x < stride; x++)
                {
                    puzzleAnswerBuilder.Append(grid[x, y] == 0 ? ' ' : '*');
                }
                puzzleAnswerBuilder.AppendLine();
            }
            Debug.WriteLine(puzzleAnswerBuilder.ToString());

            ResultPart2 = "hczrugaz";
        }
 public ChessFigure(string currentCoordinate)
 {
     CurrentCoordinate.Load(currentCoordinate);
 }