UE4 C++ 一个Character踩地雷

2023-11-11

UE4 C++ 一个Character踩地雷

在这里插入图片描述
在这里插入图片描述

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyinPlayer.generated.h"

UCLASS()
class GETSTARTED_API AMyinPlayer : public ACharacter
{
	GENERATED_BODY()

public:
	// Sets default values for this character's properties
	AMyinPlayer();

	UPROPERTY(VisibleAnywhere,BlueprintReadOnly)
		class USpringArmComponent* SpringArm;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
		class UCameraComponent* FollowCamera;

	float BaseTurnRate;
	float BaseTurnUpRate;

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Player Stats")
	float MaxHealth;//生命值
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Player Stats")
	float Health;
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Player Stats")
	float MaxStamina;//耐力

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Player Stats")
	float Stamina;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Player Stats")
	int32 Coins;

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

	virtual void Jump() override;//重写的一个函数
	void MoveForward(float value);
	void MoveRight(float value);
	void Turn(float value);
	void LookUp(float value);
	void TurnAtRate(float value);
	void LookUpAtRate(float value);
	
	void IncreaseHealth(float value);

	void IncreaseStamina(float value);

	void IncreaseCoin(int value);

	virtual float TakeDamage(float Damage, struct FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) override;
};

这里就是给角色加了一个事件任意伤害

// Fill out your copyright notice in the Description page of Project Settings.


#include "Characters/Player/MyinPlayer.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"
#include "Components/CapsuleComponent.h"
#include "Components/InputComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
// Sets default values
AMyinPlayer::AMyinPlayer()
{
 	// Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	SpringArm=CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
	SpringArm->SetupAttachment(GetRootComponent());

	SpringArm->TargetArmLength = 600.0f;
	SpringArm->bUsePawnControlRotation = true;

	FollowCamera=CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));
	FollowCamera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
	FollowCamera->bUsePawnControlRotation = false;
	GetCapsuleComponent()->SetCapsuleSize(25.0f, 100.0f);//设置胶囊体组件的高和宽

	bUseControllerRotationYaw = false;

	GetCharacterMovement()->bOrientRotationToMovement = true;//继承角色移动类里面的“将旋转朝向远动”设置为
	GetCharacterMovement()->RotationRate=FRotator(0.0f, 500.0f, 0.0f);//继上面“旋转速率”

	BaseTurnRate = 65.0f;
	BaseTurnUpRate = 65.0f;

	GetCharacterMovement()->JumpZVelocity = 500.0f;//跳的时候一个速度Z轴的速度

	GetCharacterMovement()->AirControl = 0.15f;//这是在空中的移动速度

	MaxHealth = 100.0f;
	Health = MaxHealth;
	MaxStamina = 150.f;
	Stamina = MaxStamina;
	Coins = 0;
}

// Called when the game starts or when spawned
void AMyinPlayer::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AMyinPlayer::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

// Called to bind functionality to input
void AMyinPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);
	check(PlayerInputComponent);//是否有效,可用性的检查

	PlayerInputComponent->BindAxis("MoveForward", this, &AMyinPlayer::MoveForward);//第一个是轴映射的名称
	PlayerInputComponent->BindAxis("MoveRight", this, &AMyinPlayer::MoveRight);

	PlayerInputComponent->BindAxis("Turn", this, &AMyinPlayer::Turn);
	PlayerInputComponent->BindAxis("LookUp", this, &AMyinPlayer::LookUp);

	PlayerInputComponent->BindAxis("TurnAtRate", this, &AMyinPlayer::TurnAtRate);
	PlayerInputComponent->BindAxis("LookUpAtRate", this, &AMyinPlayer::LookUpAtRate);//轴

	PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &AMyinPlayer::Jump);//按键
	PlayerInputComponent->BindAction("Jump", IE_Released, this, &AMyinPlayer::StopJumping);//落下



}

void AMyinPlayer::Jump()//跳跃
{
	Super::Jump();

}

void AMyinPlayer::MoveForward(float value)
{
	//if ((Controller != nullptr) && (value != 0.0f)) {
		//FRotator Rotation = Controller->GetControlRotation();
		//FRotator YawRotation(0.0f, Rotation.Yaw, 0.0f);
		//FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
		//AddMovementInput(Direction, value);
	//}

	AddMovementInput(FollowCamera->GetForwardVector(), value);//添加移动输入
}

void AMyinPlayer::MoveRight(float value)
{
	//if ((Controller != nullptr) && (value != 0.0f)) {
		//FRotator Rotation = Controller->GetControlRotation();
		//FRotator YawRotation(0.0f, Rotation.Yaw, 0.0f);
		//FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
		//AddMovementInput(Direction, value);
	//}
	AddMovementInput(FollowCamera->GetRightVector(), value);
}

void AMyinPlayer::Turn(float value)
{

	if (value != 0.0f)
	{
		AddControllerYawInput(value);
	}
}

void AMyinPlayer::LookUp(float value)
{
	
	if (GetControlRotation().Pitch < 270.0f && GetControlRotation().Pitch>180.0f && value > 0.0f)
	{
		return;
	}
	if (GetControlRotation().Pitch > 45.0f && GetControlRotation().Pitch < 180.0f && value < 0.0f) {
		return;
	}
	AddControllerPitchInput(value);
}

void AMyinPlayer::TurnAtRate(float value)
{
	float valuee = value * BaseTurnRate*GetWorld()->GetDeltaSeconds();//乘以一个Time函数里的DeltaTime,作用120帧和30帧的电脑跑起来一样快
	if (valuee != 0.0f)
	{
		AddControllerYawInput(value);
	}
}

void AMyinPlayer::LookUpAtRate(float value)
{
	float valuee = value * BaseTurnUpRate * GetWorld()->GetDeltaSeconds();//乘以一个Time函数里的DeltaTime,作用120帧和30帧的电脑跑起来一样快
	if (GetControlRotation().Pitch < 270.0f && GetControlRotation().Pitch>180.0f && value > 0.0f)
	{
		return;
	}
	if (GetControlRotation().Pitch > 45.0f && GetControlRotation().Pitch < 180.0f && value < 0.0f) {
		return;
	}
	AddControllerPitchInput(valuee);
}

void AMyinPlayer::IncreaseStamina(float value)
{
	Health = FMath::Clamp(Health + value, 0.0f, MaxHealth);
}

void AMyinPlayer::IncreaseCoin(int value)
{
	Stamina = FMath::Clamp(Stamina + value, 0.0f, MaxStamina);
}

//事件任意伤害
float AMyinPlayer::TakeDamage(float Damage, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
	if (Health - Damage <= 0.0f) {
		Health = FMath::Clamp(Health - Damage, 0.0f, MaxHealth);
	}
	else {
		Health -= Damage;
	}
	return Health;
}

void AMyinPlayer::IncreaseHealth(float value)
{
	Coins += value;
}


炸弹:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Gameplay/Interactableitem.h"
#include "Explosiveitem.generated.h"

/**
 * 
 */
UCLASS()
class GETSTARTED_API AExplosiveitem : public AInteractableitem
{
	GENERATED_BODY()

public :
	AExplosiveitem();

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
	float Damage;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
	TSubclassOf<UDamageType> DamageTypeClass;

public :
	virtual	void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) override;

	virtual	void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) override;


	
};

// Fill out your copyright notice in the Description page of Project Settings.


#include "Gameplay/Explosiveitem.h"
#include "Characters/Player/MyinPlayer.h"
#include "Kismet/GameplayStatics.h"
#include "Sound/SoundCue.h"
#include "Components/SphereComponent.h"
AExplosiveitem::AExplosiveitem() {
	Damage = 20.0f;
	TriggerVolume->SetSphereRadius(50.0f);
}
void AExplosiveitem::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);

	if (OtherActor) {
		const AMyinPlayer* MainPlayer = Cast<AMyinPlayer>(OtherActor);
		if (MainPlayer) {
			if (OverlapParticle) {
				UGameplayStatics::SpawnEmitterAtLocation(this, OverlapParticle, GetActorLocation(), FRotator(0.0f),true);//生成爆炸的位置

			}
			if (OverlapSound) {
				UGameplayStatics::PlaySound2D(this,OverlapSound);//播放声音
			}
			UGameplayStatics::ApplyDamage(OtherActor,Damage,nullptr,this,DamageTypeClass);//这个就是应用伤害
			Destroy();//销毁自己
		}
	}
}

void AExplosiveitem::OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
	Super::OnOverlapEnd(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex);
}

炸弹继承这个类:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Interactableitem.generated.h"

UCLASS()
class GETSTARTED_API AInteractableitem : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AInteractableitem();

	UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
	class USphereComponent* TriggerVolume;

	UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
		class UStaticMeshComponent* DisplayMesh;
	
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
	class UParticleSystemComponent* IdleParticleComponent;//粒子系统的组件

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable Item|Particles")
	class UParticleSystem* OverlapParticle;//重叠播放的粒子,可以看做一个资源

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable Item|Sounds")
	class USoundCue* OverlapSound;//一个声音的资源吧

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable Item|Item Properties")
	bool bNeedRotate;//需要旋转吗

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable Item|Item Properties")
		float RotationRate;//旋转的速率

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UFUNCTION()
	virtual	void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

	UFUNCTION()
	virtual	void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);

};

// Fill out your copyright notice in the Description page of Project Settings.


#include "Gameplay/Interactableitem.h"
#include "Components/SphereComponent.h"
#include "Components/StaticMeshComponent.h"
#include "particles/ParticleSystemComponent.h"

// Sets default values
AInteractableitem::AInteractableitem()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	TriggerVolume = CreateDefaultSubobject<USphereComponent>(TEXT("TriggerVolume"));
	RootComponent = TriggerVolume;

	// 组件 ->SetCollisionEnabled(ECollisionEnabled::NoCollision);     注释:没有碰撞
	// 组件 ->SetCollisionEnabled(ECollisionEnabled::PhysicsOnly);     注释:只有物理
	// 组件 ->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics); 注释:查询和物理
	// 组件 ->SetCollisionEnabled(ECollisionEnabled::QueryOnly);       注释:只有查询
	// 组件 ->SetCollisionEnabled(ECollisionEnabled::Type);			   注释:目前理解为自定义


	TriggerVolume->SetCollisionEnabled(ECollisionEnabled::QueryOnly);//仅查询
	TriggerVolume->SetCollisionObjectType(ECollisionChannel::ECC_WorldStatic);//设为世界静态
	TriggerVolume->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);//让所有频道都忽略
	TriggerVolume->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);//再单独开启一个Pawn 频道的一个事件

	DisplayMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("DisplayMesh"));
	DisplayMesh->SetupAttachment(GetRootComponent());

	IdleParticleComponent = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("IdleParticleComponent"));
	IdleParticleComponent->SetupAttachment(GetRootComponent());

	bNeedRotate = true;

	RotationRate = 45.0f;
}

// Called when the game starts or when spawned
void AInteractableitem::BeginPlay()
{
	Super::BeginPlay();
	TriggerVolume->OnComponentBeginOverlap.AddDynamic(this,&AInteractableitem::OnOverlapBegin);
	TriggerVolume->OnComponentEndOverlap.AddDynamic(this, &AInteractableitem::OnOverlapEnd);

}

// Called every frame
void AInteractableitem::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	if (bNeedRotate) {
		FRotator NewRotation = GetActorRotation();
		NewRotation.Yaw += RotationRate * DeltaTime;
		SetActorRotation(NewRotation);
	}

}

void AInteractableitem::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
}

void AInteractableitem::OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
}


血条绑定就是简单的蓝图绑定了!!!!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

UE4 C++ 一个Character踩地雷 的相关文章

  • Unity震撼首发,最新一代高清数字人短片《Enemies》

    我们屡获殊荣的 Demo 团队又一次在 异教徒 The Heretic 累积了超 400 万观众 的基础上取得了进展 推出了 Enemies 一支全新的电影式预告片 以 4K 分辨率的实时渲染来展示眼睛 头发和皮肤渲染等方面的重大突破 创建
  • 新仙魔九界研发及设计分析

    玩法本质属于捕鱼RPG玩法 美术风格属于国风 非常有特色 目前整体的玩法 性能优化和体验各方面都做的不错 从第三方数据平台获知该游戏目前月流水在600万 且有未来还有巨大的增长空间 这也不是波克城市第一次做出尝试 早在2015年就尝试过一个
  • 飞机大战(C语言版)

    大一下要交课程设计 于是就用C语言写了一个飞机大战小游戏 没有用到第三方库 飞机和子弹的移动使用的光标移动函数 所以没有卡顿 其中w s a d分别表示上下左右 包括大写 空格发射子弹 游戏结束后可选择是否储存游戏数据 该程序复制后可直接使
  • Unity --- Vector3类的API讲解

    1 Vector3中的静态变量是相对于世界坐标系的还是相对于自身坐标系呢 我们创建的Vector3类对象同理 答 这取决我们将创建的Vector3类对象 通过Vector3调用的静态变量传给了哪一个引用 如果是传给了positon的话 则该
  • 【unity3D】创建TextMeshPro(TMP)中文字体(解决输入中文乱码问题)

    未来的游戏开发程序媛 现在的努力学习菜鸡 本专栏是我关于游戏开发的学习笔记 本篇是unity的TMP中文输入显示乱码的解决方式 创建 TextMeshPro 中文字体 遇到的问题描述 解决方式 Font Asset Creator 面板扩展
  • UE4 UE4 C++ Gameplay Abilities 的AttributeSet和GameplayEffect

    UE4 UE4 C Gameplay Abilities 的AttributeSet和GameplayEffect GAS参考文档 仅是个人理解 参考 AttributeSet是设置玩家属性的比如生命值 最大生命值 GameplayEffe
  • unity期末作业-插针游戏

    unity期末作业 插针游戏 附下载链接 鼠标控制针的发射 圆盘可以显示接住的针数目 若两根针碰到则界面变红 游戏结束 详细情况如下动态图 点我下载 https download csdn net download weixin 43474
  • PicoNeo3开发VR——小白教程

    不断更新中 欢迎大佬们来指导 纠错 导入PicoVRSDK 1 新创一个Unity工程 Unity版本最好选择2019 4以上版本 以及需配置好安卓环境 然后导入官方picoVRSDK 2 渲染设置 Graphics APIs暂不支持Vul
  • UE4 射线检测案例(C++)

    UE4 射线检测 C 开发场景 玩家 C 开发的 武器 C 射线检测函数 蓝图 C 效果 制作流程 添加开火按键映射 新建一个继承ACharacter的C 用蓝图继承刚刚新建的C 然后设置好游戏模式 我 这是是 用了一个枚举 其实你直接调用
  • Unity MRTK使用详解(Htc vive+LeapMotion)

    MRTK Unity是一个由Microsoft驱动的开源项目 提供了多种组件和功能 用于加速Unity中的跨平台MR应用程序开发 以下是其一些功能 提供跨平台输入系统和用于空间交互和UI组件 启用快速原型通过在编辑器中的模拟 让你马上看到变
  • 【cc3.x】顶点着色器和片元着色器小记

    cc3 x cocos creator3 x 的着色器demo有点少 而且讲的不是很清晰 我这种业余自学小白学的真的很艰难 不过好赖算是啃的差不多了 所以有了这则小记 权当备忘录了 首先顶点着色器 上一段代码 CCProgram vs pr
  • Unity3D之Rigidbody

    目录 常用的Rigidbody属性和方法 rigidbody AddForce rigidbody AddTorque rigidbody velocity rigidbody angularVelocity rigidbody Sleep
  • UE4 制作导出Content目录下某个文件夹内所有模型的六视图并将模型资源文件复制到指定文件夹的插件

    一 新建空白插件 在Bulid cs内加入两个模块 EditorSubsystem UnrealEd PublicDependencyModuleNames AddRange new string Core EditorSubsystem
  • unity网络资源导入

    1 找到需要导入的文件 这里导入fbx格式 2 打开unity界面 在Asset目录下创建文件夹FBX 将需要导入的fbx预制体或整个文件夹拖入创建的FBX文件夹下 3 选中需要的fbx预制体并拖至场景中 4 双击定位到当前物体 5 找到需
  • 投资捕鱼游戏市场的如何避雷?以及研发技术问题。

    随着国内捕鱼市场在姚记科技 波克城市 途游等捕鱼龙头的深耕下 整个产品的研发 运营门槛都了非常大的提高 对于目前想要研发出一款具有竞争力的产品和版本 投入低于500万的资金很难出有竞争力的产品 加上运营门槛的提高 运营成本至少需要准备500
  • Unity保存图片到相册

    Unity保存图片到Android相册 Java 纯文本查看 复制代码 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  • Unity万向节死锁解决方案(2023/12/4)

    1 万向节死锁无法解决 这是因为它的特性就是如此 就像玻璃杯就是玻璃 这不可否认 别钻牛角尖昂 2 大多数情况下欧拉角足够用 例如 CF 摄像机不可能绕z轴旋转 x轴旋转也不会超过九十度 因为那样人物的腰子会被扭断 塔防游戏 保卫萝卜 吃鸡
  • mixamo根动画导入UE5问题:滑铲

    最近想做一个跑酷游戏 从mixamo下载滑铲动作后 出了很多动画的问题 花了两周时间 终于是把所有的问题基本上都解决了 常见问题 1 动画序列 人物不移动 2 动画序列 人物移动朝向错误 3 蒙太奇 人物移动后会被拉回 4 蒙太奇 动画移动
  • 【Unity】如何让Unity程序一打开就运行命令行命令

    背景 Unity程序有时依赖于某些服务去实现一些功能 此时可能需要类似打开程序就自动运行Windows命令行命令的功能 方法 using UnityEngine using System Diagnostics using System T
  • Unity中URP下的指数雾

    文章目录 前言 一 指数雾 雾效因子 1 FOG EXP 2 FOG EXP2 二 MixFog 1 ComputeFogIntensity 雾效强度计算 2 lerp fogColor fragColor fogIntensity 雾效颜

随机推荐

  • Ubuntu系统下《汇编语言》环境配置

    说明 1 系统 Ubuntu codists pc lsb release a No LSB modules are available Distributor ID Ubuntu Description Ubuntu 21 10 Rele
  • C语言实现快速排序与归并排序

    快排 代码如下 include
  • 深度学习框架太抽象?其实不外乎这五大核心组件

    转 http www leiphone com news 201701 DZeAwe2qgx8JhbU8 html 导语 一般深度学习框架都会包括的五大核心组件都有哪些 许多初学者觉得深度学习框架抽象 虽然调用了几个函数 方法 计算了几个数
  • 电阻中联分压电路的计算

    方法一 如下图所示 大概1K 分压1V Vp Vin x R2 R1 R2 3Vx2K 1K 2K 2V 结论 R2增加P增加 R1减小 P增加 方法二 用工具计算 如下图
  • 软件设计师备考——第七章 面向对象

    软件设计师备考 第七章 面向对象 一 面向对象基础 1 面向对象的基本概念 2 类 3 对象 4 消息 二 方法 1 方法重载 2 封装 3 继承 4 多态 5 静态 动态绑定 三 面向对象设计 1 面向对象设计原则 2 面向对象分析 3
  • Git:husky > npm run -s precommit

    git commit前检测husky与pre commit 问题 我是通过vs code 编辑器中进行提交代码 以往都是在勾选上需要提交的文件后 并输入提交描述 点击commit就提交成功了 但是今天点击commit突然报错 思路 先想办法
  • centos red5 添加成为服务并且设置开机自启动

    1 vi etc init d red5 创建tomcat red5 2 在red5中添加如下的内容 一定要在头部添加java环境的引用 否则可能启动不成功 说明 其中的JAVA HOME要设置为本机真实的java路径 RED5 HOME也
  • matlab 画随机数图,怎么用matlab生成100个标准正态分布的随机数并画出直方图

    正态分布是normpdf x mu sigma mu sigma 默认是 0 1例子ez 由热心网友提供的答案1 生成一组随机数 正态分布 data normrnd 0 1 1 500 绘制直方图hist d f normrnd 0 1 1
  • StrongSORT(deepsort强化版)学习体会

    少废话 先做备忘录 StrongSORT deepsort强化版 浅实战 代码解析 参考 https blog csdn net weixin 50862344 article details 127070391 https github
  • 关于angular2路由传参

    在开发一个网站中遇到需要在路由传参的需求 一个示例列表组件 其中每个示例项点击进入均可加载该示例详情页 在路由中传参有3种方法 1 routerLink 单一参数 在 a a 中加routerLink进行跳转 其中 exampledetai
  • SpringBoot3.0都正式发布了,尝鲜之前先搞明白AQS底层再说!

    V xin ruyuanhadeng获得600 页原创精品文章汇总PDF 一 写在前面 上一篇文章聊了一下java并发中常用的原子类的原理和Java 8的优化 具体请参见文章 为什么程序员招聘都要5年经验起 因为他们懂Java8底层优化 这
  • 测试工程师的核心竞争力

    基础能力 1 测试策略设计能力 测试策略设计能力是指 对于各种不同的被测软件 能够快速准确地理解需求 并在有限的时间和资源下 明确测试重点以及最适合的测试方法的能力 例如 测试要具体执行到什么程度 测试需要借助于什么工具 如何运用自动化测试
  • git - 简明指南

    安装 下载 git OSX 版 下载 git Windows 版 Linux自己通过yum apt get等命令安装 创建新仓库 创建新文件夹 打开 然后执行 git init 以创建新的 git 仓库 检出仓库 执行如下命令以创建一个本地
  • SpringBoot使用Slf4j进行日志配置

    首先在resource文件夹下面创建logback spring xml文件
  • eslint+prettier前端代码规范配置

    前端代码规范配置 参考来源 https blog csdn net u013361179 article details 108885859 前言 eslint的作用 eslint作用是按照一定规则 检测代码质量 prettier的作用 p
  • Hyperledger Fabric网络快速启动

    目录 1 网络服务配置 2 关联的docker compose base yaml 各Peer节点容器设置如下信息 3 被关联的Peer base yaml 4 启动网络 2 完成通道的创建 2 1将节点加入应用通道 更新锚节点 2 为什么
  • 【数据结构实验】哈希表设计

    数据结构实验 哈希表设计 简介 针对本班同学中的人名设计一个哈希表 使得平均查找长度不超过R 完成相应的建表和查表程序 文末贴出了源代码 需求分析 假设人名为中国人姓名的汉语拼音形式 待填入哈希表的人名共有三十个左右 取平均查找长度上限为2
  • python将dataframe输出到word文档中

    python将文本 dataframe输出到word文档中 加载基本库 from docx import Document import pandas as pd temp name link dir south beizhu test d
  • 【2019.09.08】python 基于Excel设计实现的关键字驱动的自动化测试框架

    之前写过PO模式 数据驱动的测试框架 最近要做一个测试平台 先写一个关键字驱动的测试框架练练手 Excel 样式展示 如图 结果展示 代码 结构 读取excel usr bin env python coding utf 8 Time 20
  • UE4 C++ 一个Character踩地雷

    UE4 C 一个Character踩地雷 Fill out your copyright notice in the Description page of Project Settings pragma once include Core