예제 #1
0
        public static SceneState FromMatrix(Matrix matrix)
        {
            var sceneState = new SceneState
            {
                Energy        = 0,
                HarmonicsMode = HarmonicsMode.Grounded,
                Matrix        = matrix,
            };

            sceneState.Bots = new SortedSet <NanoBot>(
                new[] { NanoBot.Initial() },
                new NanoBotComparer());

            return(sceneState);
        }
예제 #2
0
        public static SceneState New(int resolution)
        {
            var sceneState = new SceneState
            {
                Energy        = 0,
                HarmonicsMode = HarmonicsMode.Grounded,
                Matrix        = Matrix.Empty(resolution),
            };

            sceneState.Bots = new SortedSet <NanoBot>(
                new[] { NanoBot.Initial() },
                new NanoBotComparer());

            return(sceneState);
        }
예제 #3
0
 public Scene ApplyCommand(BotCommand command)
 {
     SceneState = command.Apply(SceneState);
     return(this);
 }
예제 #4
0
 private Scene(int resolution)
 {
     SceneState = SceneState.New(resolution);
 }