/// <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); }
} // 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
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); } }
/// <summary> /// Creates a respawn anchor block /// </summary> /// <param name="type">The type of block</param> public RespawnAnchor(IBlockType type) : base(type) { }
protected Block(IBlockType blockType) { BlockType = blockType; }
/// <summary> /// Creates a new stem block /// </summary> /// <param name="type">The type of block</param> public AttachedPumpkinMelonStem(IBlockType type) : base(type) { }
public string GetStatePath(IBlockType block) { _ = block; throw new PathGettingMethodCallException(); }
/// <summary> /// Creates a chain block /// </summary> /// <param name="type">The type of block</param> public Chain(IBlockType type) : base(type) { }
/// <summary> /// Creates a nether vine block /// </summary> /// <param name="type">The type of block</param> public NetherVines(IBlockType type) : base(type) { }
/// <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; }
/// <summary> /// Creates a daylight detector block /// </summary> /// <param name="type">The type of block</param> public Target(IBlockType type) : base(type) { }
public BlockTypeChangingEventArgs(IBlock block, IBlockType newBlockType) { Block = block; NewBlockType = newBlockType; }