Exemplo n.º 1
0
            /// <summary>
            /// Used for generating state datapaths.
            /// </summary>
            /// <param name="convertionInfo">Data on how the paths should be generated</param>
            /// <param name="caller">The method/property calling this method</param>
            /// <param name="arguments">Arguments from the calling method</param>
            protected static string StatePathGenerator(DataConvertionAttribute convertionInfo, MemberInfo caller, IReadOnlyCollection <Expression>?arguments)
            {
                _ = caller;
                _ = convertionInfo;
                IBlockType block = (Expression.Lambda(arguments.ToArray()[0]).Compile().DynamicInvoke() as IBlockType) !;

                return(block.Name);
            }
Exemplo n.º 2
0
        }                                    // end constructor method Block

        /// <summary>
        /// This method allocates the correct block type to use based on the BlockType enum.
        /// </summary>
        /// <param name="blockType"></param>
        public void DecideBlockType(BlockType blockType)
        {
            switch (blockType)
            {
            case BlockType.Solid:
                iBlockType = new SolidBlock(this);
                break;

            case BlockType.Hollow:
                iBlockType = new HollowBlock(this);
                break;

            case BlockType.Fade:
                iBlockType = new FadedBlock(this);
                break;

            default:
                break;
            }
        } // end method DecideBlockType
Exemplo n.º 3
0
    void ChangeGameObjectRotation(IBlockType obj)
    {
        if (obj == null)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            obj.Rotate(Vector3.up, -90f, Space.Self);
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            obj.Rotate(Vector3.up, 90f, Space.Self);
        }

        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            obj.Rotate(Vector3.right, 180f, Space.Self);
        }
    }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a respawn anchor block
 /// </summary>
 /// <param name="type">The type of block</param>
 public RespawnAnchor(IBlockType type) : base(type)
 {
 }
Exemplo n.º 5
0
 protected Block(IBlockType blockType)
 {
     BlockType = blockType;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new stem block
 /// </summary>
 /// <param name="type">The type of block</param>
 public AttachedPumpkinMelonStem(IBlockType type) : base(type)
 {
 }
Exemplo n.º 7
0
 public string GetStatePath(IBlockType block)
 {
     _ = block;
     throw new PathGettingMethodCallException();
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a chain block
 /// </summary>
 /// <param name="type">The type of block</param>
 public Chain(IBlockType type) : base(type)
 {
 }
Exemplo n.º 9
0
 /// <summary>
 /// Creates a nether vine block
 /// </summary>
 /// <param name="type">The type of block</param>
 public NetherVines(IBlockType type) : base(type)
 {
 }
Exemplo n.º 10
0
 /// <summary>
 /// Intializes a new <see cref="CopyStateChange"/>
 /// </summary>
 /// <param name="id">The block to copy the state from</param>
 /// <param name="states">The states to copy</param>
 public CopyStateChange(IBlockType id, string[] states) : base("minecraft:copy_state")
 {
     Id     = id;
     States = states;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a daylight detector block
 /// </summary>
 /// <param name="type">The type of block</param>
 public Target(IBlockType type) : base(type)
 {
 }
Exemplo n.º 12
0
		public BlockTypeChangingEventArgs(IBlock block, IBlockType newBlockType)
		{
			Block = block;
			NewBlockType = newBlockType;
		}