parent
91cd4ad128
commit
9135b664ad
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018 the original author or authors.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
|
||||||
|
* applicable law or agreed to in writing, software distributed under the
|
||||||
|
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||||
|
* OF ANY KIND, either express or implied. See the License for the specific
|
||||||
|
* language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.github.drinkjava2.frog.brain;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cube include 0~n cells and 0~n photons
|
||||||
|
*
|
||||||
|
* @author Yong Zhu
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
public class Cube {
|
||||||
|
Cell[] cells = new Cell[] {};
|
||||||
|
|
||||||
|
Photon[] photons = new Photon[] {};
|
||||||
|
|
||||||
|
public void addCell(Cell cell) {// 每个方格空间可以存在多个脑细胞
|
||||||
|
cells = Arrays.copyOf(cells, cells.length + 1);
|
||||||
|
cells[cells.length - 1] = cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPhoton(Photon p) {// 每个方格空间可以存在多个光子
|
||||||
|
for (Photon old : photons)
|
||||||
|
if (old.energy < 0.01 && p.energy > -0.01) {// 如果能量没有了,用新的代替空位
|
||||||
|
old.x = p.x;
|
||||||
|
old.y = p.y;
|
||||||
|
old.z = p.z;
|
||||||
|
old.energy = p.energy;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
photons = Arrays.copyOf(photons, photons.length + 1);// 否则追加新光子到未尾
|
||||||
|
photons[cells.length - 1] = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removePhoton(int i) {// 清除光子
|
||||||
|
photons[i].energy = 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018 the original author or authors.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
|
||||||
|
* applicable law or agreed to in writing, software distributed under the
|
||||||
|
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||||
|
* OF ANY KIND, either express or implied. See the License for the specific
|
||||||
|
* language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.github.drinkjava2.frog.brain.organ;
|
||||||
|
|
||||||
|
import com.github.drinkjava2.frog.Env;
|
||||||
|
import com.github.drinkjava2.frog.Frog;
|
||||||
|
import com.github.drinkjava2.frog.brain.Organ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* D means D
|
||||||
|
*
|
||||||
|
* @author Yong Zhu
|
||||||
|
*/
|
||||||
|
public class D extends Organ {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public D() {
|
||||||
|
x = 35;
|
||||||
|
y = 15;
|
||||||
|
z = Env.FROG_BRAIN_ZSIZE - 1;
|
||||||
|
xe = 3;
|
||||||
|
ye = 3;
|
||||||
|
ze = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void active(Frog f) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
这个捐款记录的目的是为了让收支透明化,万一项目做大了,收到码云平台外的捐款也可以在这里记录下来。本记录按时间顺序记录捐款人和当前总额,不记具体数额,这样即体现了不鼓励金额攀比、自愿随意的原则,也能通过历史记录查询出每笔的具体数额。在此衷心地感谢每一位捐款、点赞、及关注这个项目的同学!
|
这个捐款记录的目的是为了让收支透明化,万一项目做大了,收到码云平台外的捐款也可以在这里记录下来。本记录按时间顺序记录捐款人和当前总额,不记具体数额,这样即体现了不鼓励金额攀比、自愿随意的原则,也能通过历史记录查询出每笔的具体数额。在此衷心地感谢每一位捐款、点赞、及关注这个项目的同学!
|
||||||
|
|
||||||
捐款人(按时间顺序):
|
捐款人(按时间顺序):
|
||||||
wangtao
|
wangtao
|
||||||
dotao
|
dotao
|
||||||
LongFer
|
LongFer
|
||||||
|
|
||||||
|
|
||||||
目前收入总额:48.88元
|
目前收入总额:48.88元
|
||||||
|
Loading…
Reference in new issue